On a journey to create a AWS global terragrunt configuration including in AWS China

22 Views Asked by At

I have been using terragrunt for a while but only with a single region. As I was investigating, I found out that in AWS China there are different ARN naming conventions and I am planning to use the same modules globally, f.e. _envcommon references to hashicorp terraform-aws-modules for most of the resources and in house built modules for specific resources.

The structure of the terragrunt files would be like the following:

PROD:
  account.hcl
  eu-central-1:
      PROD:
          env.hcl
          ec2:
              terragrunt.hcl
  eu-east-1:
      PROD:
          env.hcl
          ec2:
              terragrunt.hcl
  cn-north-1:
      PROD:
          env.hcl
          ec2:
              terragrunt.hcl
  cn-northwest-1:
      PROD:
          env.hcl
          ec2:
              terragrunt.hcl
terragrunt.hcl
accounts.hcl

I am very curios if the provider configuration should look like the following or considering china there is still some tunning to be made

terragrunt.hcl(root of the terragrunt repo):

generate "provider" {
  path      = "provider.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF
provider "aws" {
  region  = "${local.aws_region}"
  assume_role {
    role_arn = "arn:aws:iam::${local.aws_account_id}:role/terragrunt_write"
  }
  allowed_account_ids = ["${local.aws_account_id}"]
}
EOF
}

The reason for asking is that, as I mentioned, there are a few resources like aws_partition that are mentioned as a requirement when it comes to terraform (pure), but what about terragrunt

Please can you help me to find more information on how to understand what are the requirements for a global terragrunt repo, that includes china as well ?

0

There are 0 best solutions below