Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Design patterns 如何将aws(可以是任何云)提供商详细信息自动添加到terragrunt.hcl中_Design Patterns_Terraform_Terragrunt - Fatal编程技术网

Design patterns 如何将aws(可以是任何云)提供商详细信息自动添加到terragrunt.hcl中

Design patterns 如何将aws(可以是任何云)提供商详细信息自动添加到terragrunt.hcl中,design-patterns,terraform,terragrunt,Design Patterns,Terraform,Terragrunt,我的Terragrunt文件夹结构如下所示 |-- eu-west-1 | |-- product | | |-- prod | | | |-- 5.7 | | | |-- 6.2 | | | |-- development | | | | |-- fargate-clusters | | | | | |-- module.tf.json | | | | | `-- terragrunt.hc

我的Terragrunt文件夹结构如下所示

|-- eu-west-1
|   |-- product
|   |   |-- prod
|   |   |   |-- 5.7
|   |   |   |-- 6.2
|   |   |   |-- development
|   |   |   |   |-- fargate-clusters
|   |   |   |   |   |-- module.tf.json
|   |   |   |   |   `-- terragrunt.hcl
|   |   |   |   `-- uiapp
|   |   |   |       |-- terragrunt.hcl
|   |   |   |       `-- module.tf.json
|   |   |   `-- env.hcl
|   |   |-- dev
|   |   |   |-- 5.7
|   |   |   |   |-- fargate-clusters
|   |   |   |   |   |-- module.tf.json
|   |   |   |   |   `-- terragrunt.hcl
|   |   |   |   `-- uiapp
|   |   |   |       |-- terragrunt.hcl
|   |   |   |       `-- module.tf.json
|   |   |   |-- development
|   |   |   |   |-- fargate-clusters
|   |   |   |   |   |-- module.tf.json
|   |   |   |   |   `-- terragrunt.hcl
|   |   |   |   `-- uiapp
|   |   |   |       |-- terragrunt.hcl
|   |   |   |       `-- module.tf.json
|   |   |   `-- env.hcl
|   |-- region.hcl
|-- README.md
`-- terragrunt.hcl
我在terragrunt.hcl中配置了多个帐户

provider "aws" {
  alias  = "product-dev"
  region = "${local.aws_region}"
  assume_role {
    role_arn     = "arn:aws:iam::123456789:role/TerraformRole"
  }
}
我们管理的AWS账户超过50个,我们一直在向Terragrunt添加新的账户

是否已经有一个已知的模式可以动态地告诉terraform/terragrunt新的帐户id和要承担的IAM角色

现在,每次我都必须手动将提供者添加到terragrunt.hcl中,并将帐户id添加到env.hcl中