Terraform 平台间共享基础设施的terragrunt
我使用s3作为远程状态后端,使用dynamodb表进行锁定 platform1和platform2都使用共享平台的共享基础设施 如果我尝试先创建platform1,它将失败,因为共享中的依赖项尚未创建,platform2也是如此,但如果我先创建共享平台,然后创建platform1和platform2,所有基础设施都将顺利构建 这是正确的吗? 在尝试构建其中一个平台环境时,如何首先构建共享环境 我已经尝试过先创建共享环境 根terragrunt.hcl文件,即在tst1文件夹下Terraform 平台间共享基础设施的terragrunt,terraform,terragrunt,Terraform,Terragrunt,我使用s3作为远程状态后端,使用dynamodb表进行锁定 platform1和platform2都使用共享平台的共享基础设施 如果我尝试先创建platform1,它将失败,因为共享中的依赖项尚未创建,platform2也是如此,但如果我先创建共享平台,然后创建platform1和platform2,所有基础设施都将顺利构建 这是正确的吗? 在尝试构建其中一个平台环境时,如何首先构建共享环境 我已经尝试过先创建共享环境 根terragrunt.hcl文件,即在tst1文件夹下 # Configu
# Configure Terragrunt to automatically store tfstate files in an S3 bucket
remote_state {
backend = "s3"
config = {
encrypt = true
bucket = "automation-terraform-state"
key = "tst1/${path_relative_to_include()}/terraform.tfstate"
region = "ap-southeast-2"
dynamodb_table = "tst-terraform-locks"
}
}
# Configure root level variables that all resources can inherit. This is especially helpful with multi-account configs
# where terraform_remote_state data sources are placed directly into the modules.
inputs = {
aws_region = "ap-southeast-2"
ami_id = "ami-0aa5848a455c3ec32"
vpc_id = "vpc-7e49e81a"
}
terragrunt.hcl平台内1
terraform {
source = "git::git@github.com:acme/infrastructure-modules.git//application_lb"
}
# Include all settings from the root terragrunt.hcl file
include {
path = find_in_parent_folders()
}
inputs = {
...
...
...
}
有一个
dependencies
块,我认为它应该有助于解决这个问题(请参阅)。。。但是我还没有弄清楚细节/我对这个领域还很陌生,所以也很挣扎。。。