From fc431191786fe86490433b9e9f7f810db89cb491 Mon Sep 17 00:00:00 2001 From: vivek-tech-exp <101738487+vivek-tech-exp@users.noreply.github.com> Date: Thu, 30 Jan 2025 17:21:32 +0530 Subject: [PATCH] chore(aws_govcloud): create a AWS Govcloud replica module of AWS refactor: undo changes made to the original aws module --- .../cloud-integrations/aws-govcloud/main.tf | 320 ++++++++++++++++++ .../aws-govcloud/providers.tf | 10 + .../aws-govcloud/variables.tf | 25 ++ .../modules/cloud-integrations/aws/main.tf | 3 +- .../cloud-integrations/aws/variables.tf | 2 +- 5 files changed, 357 insertions(+), 3 deletions(-) create mode 100644 examples/modules/cloud-integrations/aws-govcloud/main.tf create mode 100644 examples/modules/cloud-integrations/aws-govcloud/providers.tf create mode 100644 examples/modules/cloud-integrations/aws-govcloud/variables.tf diff --git a/examples/modules/cloud-integrations/aws-govcloud/main.tf b/examples/modules/cloud-integrations/aws-govcloud/main.tf new file mode 100644 index 000000000..1b65d0193 --- /dev/null +++ b/examples/modules/cloud-integrations/aws-govcloud/main.tf @@ -0,0 +1,320 @@ +data "aws_iam_policy_document" "newrelic_assume_policy" { + statement { + actions = ["sts:AssumeRole"] + + principals { + type = "AWS" + // This is the unique identifier for New Relic account on AWS, there is no need to change this + identifiers = [var.new_relic_aws_govcloud_account_id] + } + + condition { + test = "StringEquals" + variable = "sts:ExternalId" + values = [var.newrelic_account_id] + } + } +} + +resource "aws_iam_role" "newrelic_aws_role" { + name = "NewRelicInfrastructure-Integrations-${var.name}" + description = "New Relic Cloud integration role" + assume_role_policy = data.aws_iam_policy_document.newrelic_assume_policy.json +} + +resource "aws_iam_policy" "newrelic_aws_permissions" { + name = "NewRelicCloudStreamReadPermissions-${var.name}" + description = "" + policy = <