Browse Source

Merge pull request #604 from mdr-engineering/feature/ftd_MSOCI-2042_GetGitHubBackOnAWS4

Updates Codebuild Modules back to AWS 4
Frederick Damstra 3 năm trước cách đây
mục cha
commit
f6fda65dd7
19 tập tin đã thay đổi với 61 bổ sung1228 xóa
  1. 1 70
      000-skeleton/360-codebuild-splunk-apps/terragrunt.hcl
  2. 2 91
      common/aws-us-gov/afs-mdr-common-services-gov/075-codebuild-ecr-base/terragrunt.hcl
  3. 1 1
      common/aws-us-gov/afs-mdr-common-services-gov/085-codebuild-ecr-customer-portal/terragrunt.hcl
  4. 1 1
      common/aws-us-gov/afs-mdr-common-services-gov/350-codebuild-ecr-content-generator-build-image/terragrunt.hcl
  5. 28 15
      common/aws-us-gov/afs-mdr-common-services-gov/351-codebuild-splunk-uf-configs/terragrunt.hcl
  6. 2 91
      common/aws-us-gov/afs-mdr-common-services-gov/355-codebuild-xdr-base-image/terragrunt.hcl
  7. 2 71
      prod/aws-us-gov/mdr-prod-afs/360-codebuild-splunk-apps/terragrunt.hcl
  8. 2 71
      prod/aws-us-gov/mdr-prod-bas/360-codebuild-splunk-apps/terragrunt.hcl
  9. 2 71
      prod/aws-us-gov/mdr-prod-c2/360-codebuild-splunk-apps/terragrunt.hcl
  10. 2 89
      prod/aws-us-gov/mdr-prod-c2/380-codebuild-portal-lambda/terragrunt.hcl
  11. 2 71
      prod/aws-us-gov/mdr-prod-ca-c19/360-codebuild-splunk-apps/terragrunt.hcl
  12. 2 71
      prod/aws-us-gov/mdr-prod-dc-c19/360-codebuild-splunk-apps/terragrunt.hcl
  13. 2 71
      prod/aws-us-gov/mdr-prod-dgi/360-codebuild-splunk-apps/terragrunt.hcl
  14. 2 71
      prod/aws-us-gov/mdr-prod-frtib/360-codebuild-splunk-apps/terragrunt.hcl
  15. 2 71
      prod/aws-us-gov/mdr-prod-la-c19/360-codebuild-splunk-apps/terragrunt.hcl
  16. 2 71
      prod/aws-us-gov/mdr-prod-nga/360-codebuild-splunk-apps/terragrunt.hcl
  17. 2 71
      test/aws-us-gov/mdr-test-c2/360-codebuild-splunk-apps/terragrunt.hcl
  18. 2 89
      test/aws-us-gov/mdr-test-c2/380-codebuild-portal-lambda/terragrunt.hcl
  19. 2 71
      test/aws-us-gov/mdr-test-modelclient/360-codebuild-splunk-apps/terragrunt.hcl

+ 1 - 70
000-skeleton/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,17 +7,6 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
@@ -27,64 +16,6 @@ terraform {
   source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v1.00.00"
 }
 
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
-}
-
 #Github specific provider
 generate "required_providers" {
   path      = "required_provider.tf"
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 91
common/aws-us-gov/afs-mdr-common-services-gov/075-codebuild-ecr-base/terragrunt.hcl

@@ -7,97 +7,8 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Generate our standard tags
-  standard_tags = merge(
-    local.global_vars.locals.global_tags,
-    local.environment_vars.locals.environment_tags,
-    local.partition_vars.locals.partition_tags,
-    local.region_vars.locals.region_tags,
-    local.account_vars.locals.account_tags
-  )
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-
-provider "aws" {
-  region = "${local.aws_region}"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-
-  profile = "${local.common_profile}"
-
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
 }
 
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
-}
-
-
 #Github specific provider
 generate "required_providers" {
   path      = "required_provider.tf"
@@ -107,7 +18,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"
@@ -130,7 +41,7 @@ EOF
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_base?ref=v4.0.11"
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_base?ref=v4.1.4"
 }
 
 # Include all settings from the root terragrunt.hcl file

+ 1 - 1
common/aws-us-gov/afs-mdr-common-services-gov/085-codebuild-ecr-customer-portal/terragrunt.hcl

@@ -13,7 +13,7 @@ locals {
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_customer_portal?ref=v4.0.0"
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_customer_portal?ref=v4.1.4"
 }
 
 dependency "codebuild-ecr-base" {

+ 1 - 1
common/aws-us-gov/afs-mdr-common-services-gov/350-codebuild-ecr-content-generator-build-image/terragrunt.hcl

@@ -13,7 +13,7 @@ locals {
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_project?ref=v4.0.0"
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_project?ref=v4.1.4"
 }
 
 dependency "codebuild-ecr-base" {

+ 28 - 15
common/aws-us-gov/afs-mdr-common-services-gov/351-codebuild-splunk-uf-configs/terragrunt.hcl

@@ -13,7 +13,7 @@ locals {
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_artifact?ref=v3.6.5"
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_artifact?ref=v4.1.4"
 }
 
 dependency "codebuild-ecr-base" {
@@ -21,28 +21,41 @@ dependency "codebuild-ecr-base" {
 }
 
 #Github specific provider
+generate "required_providers" {
+  path      = "required_provider.tf"
+  if_exists = "overwrite_terragrunt"
+  contents  = <<EOF
+terraform {
+  required_providers {
+    aws = {
+      source = "hashicorp/aws"
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+    }
+    vault = {
+      source = "hashicorp/vault"
+      version = "= 2.19.1" # 2021-04-29: upgrade from 2.18.0
+    }
+    sensu = {
+      source = "jtopjian/sensu"
+      version = "= 0.10.5"
+    }
+    github = {
+      source = "integrations/github"
+      version = "4.2.0"
+    }
+  }
+}
+EOF
+}
+
 generate "github-provider" {
   path      = "github-provider.tf"
   if_exists = "overwrite_terragrunt"
   contents  = <<EOF
-#terraform {
-#  required_providers {
-#    github = {
-#      source = "integrations/github"
-#      version = "4.2.0"
-#    }
-#  }
-#}
-#Provider block for Github engineering. 
 provider "github" {
   owner        = "mdr-engineering"
   base_url     = "https://github.xdr.accenturefederalcyber.com/"
 }
-#Provider block for Github MDR Content. 
-#provider "github" {
-#  organization = "MDR-Content"
-#  base_url     = "https://github.xdr.accenturefederalcyber.com/"
-#}
 EOF
 }
 

+ 2 - 91
common/aws-us-gov/afs-mdr-common-services-gov/355-codebuild-xdr-base-image/terragrunt.hcl

@@ -7,97 +7,8 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Generate our standard tags
-  standard_tags = merge(
-    local.global_vars.locals.global_tags,
-    local.environment_vars.locals.environment_tags,
-    local.partition_vars.locals.partition_tags,
-    local.region_vars.locals.region_tags,
-    local.account_vars.locals.account_tags
-  )
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-
-provider "aws" {
-  region = "${local.aws_region}"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-
-  profile = "${local.common_profile}"
-
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
 }
 
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
-}
-
-
 #Github specific provider
 generate "required_providers" {
   path      = "required_provider.tf"
@@ -107,7 +18,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"
@@ -130,7 +41,7 @@ EOF
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_project_no_artifact?ref=v4.0.11"
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_project_no_artifact?ref=v4.1.4"
 }
 
 # Include all settings from the root terragrunt.hcl file

+ 2 - 71
prod/aws-us-gov/mdr-prod-afs/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-bas/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-c2/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 89
prod/aws-us-gov/mdr-prod-c2/380-codebuild-portal-lambda/terragrunt.hcl

@@ -7,100 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Generate our standard tags
-  standard_tags = merge(
-    local.global_vars.locals.global_tags,
-    local.environment_vars.locals.environment_tags,
-    local.partition_vars.locals.partition_tags,
-    local.region_vars.locals.region_tags,
-    local.account_vars.locals.account_tags
-  )
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
-
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_portal_lambda?ref=v4.1.0"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-
-provider "aws" {
-  region = "${local.aws_region}"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  
-  profile = "${local.common_profile}"
-
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_portal_lambda?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -112,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-ca-c19/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-dc-c19/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-dgi/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-frtib/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-la-c19/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
prod/aws-us-gov/mdr-prod-nga/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
test/aws-us-gov/mdr-test-c2/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 89
test/aws-us-gov/mdr-test-c2/380-codebuild-portal-lambda/terragrunt.hcl

@@ -7,100 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Generate our standard tags
-  standard_tags = merge(
-    local.global_vars.locals.global_tags,
-    local.environment_vars.locals.environment_tags,
-    local.partition_vars.locals.partition_tags,
-    local.region_vars.locals.region_tags,
-    local.account_vars.locals.account_tags
-  )
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
-
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_portal_lambda?ref=v4.1.0"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-
-provider "aws" {
-  region = "${local.aws_region}"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  
-  profile = "${local.common_profile}"
-
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_portal_lambda?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -112,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"

+ 2 - 71
test/aws-us-gov/mdr-test-modelclient/360-codebuild-splunk-apps/terragrunt.hcl

@@ -7,82 +7,13 @@ locals {
   region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
   global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
-
-  # Extract the variables we need for easy access
-  account_name   = local.account_vars.locals.account_name
-  account_id     = local.account_vars.locals.aws_account_id
-  aws_region     = local.region_vars.locals.aws_region
-  aws_partition  = local.partition_vars.locals.aws_partition
-  common_services_account = local.partition_vars.locals.common_services_account
-  legacy_account = local.environment_vars.locals.legacy_account
-  tfstate_region = local.partition_vars.locals.tfstate_region
-
-  common_profile = local.partition_vars.locals.common_profile
 }
 
 # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
 # working directory, into a temporary folder, and execute your Terraform commands in that folder.
 terraform {
   # Double slash is intentional and required to show root of modules
-  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.0.13"
-}
-
-# ---------------------------------------------------------------------------------------------------------------------
-# Generate an AWS provider block
-# Temp fix to backlevel provider because of codebuild issue
-# <insert github link here to provider issue>
-# ---------------------------------------------------------------------------------------------------------------------
-generate "provider" {
-  path      = "provider.tf"
-  if_exists = "overwrite_terragrunt"
-  contents  = <<EOF
-provider "template" {
-}
-provider "aws" {
-  region = "${local.aws_region}"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.account_id}:role/user/mdr_terraformer"
-    session_name = "terraform-default"
-  }
-  profile = "${local.common_profile}"
-  # Only these AWS Account IDs may be operated on by this template
-  allowed_account_ids = ["${local.account_id}"]
-}
-# The "common" provider in the respective partition is always available
-provider "aws" {
-  region = "${local.aws_region}"
-  allowed_account_ids = [ "471284459109", "701290387780" ]
-  profile = "${local.common_profile}"
-  alias   = "common"
-  assume_role {
-    role_arn = "arn:${local.aws_partition}:iam::${local.common_services_account}:role/user/mdr_terraformer"
-    session_name = "terraform-common"
-  }
-}
-# The "mdr-common-services-commercial" provider is used for public DNS entries
-provider "aws" {
-  region = "us-east-1"
-  allowed_account_ids = [ "471284459109" ]
-  profile = "commercial"
-  alias   = "mdr-common-services-commercial"
-  assume_role {
-    role_arn = "arn:aws:iam::471284459109:role/user/mdr_terraformer"
-    session_name = "terraform-mdr-common-services-commercial"
-  }
-}
-# The "C2" provider, used for private DNS
-provider "aws" {
-  region = "us-gov-east-1"
-  allowed_account_ids = [ "721817724804", "738800754746" ]
-  profile = "govcloud"
-  alias   = "c2"
-  #use_fips_endpoint = true
-  assume_role {
-    role_arn = "arn:aws-us-gov:iam::${ local.environment_vars.locals.c2_accounts["aws-us-gov"] }:role/user/mdr_terraformer"
-    session_name = "terraform-c2"
-  }
-}
-EOF
+  source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_splunk_apps?ref=v4.1.4"
 }
 
 #Github specific provider
@@ -94,7 +25,7 @@ terraform {
   required_providers {
     aws = {
       source = "hashicorp/aws"
-      version = "= 3.63.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
+      version = "= 4.4.0" # 2022-03-08: upgrade from 3.63.0; 2021-09-21: upgrade from 3.37.0
     }
     vault = {
       source = "hashicorp/vault"