我试图从variables.tf文件中访问terragrunt.hcl文件中的变量。
项目结构:
| Terraform
| shared-folder
- variables.tf
-vars.tf
-terragrunt.hcl这是来自.hcl文件的代码片段
locals{
account_vars = "${get_parent_terragrunt_dir()}/variables.tf"
env = local.account_vars.locals.account_name
}
remote_state {
backend = "s3"
config = {
bucket = get_env("STATEFILE_BUCKET", "terragrunt-${get_aws_account_id()}-statefiles")
key = "jsworld/state/jsTutorial-${local.env}.tfstate"
}
}variables.tf
locals {
account_name = "devl"
}如何将其访问到.hcl文件中?
发布于 2022-10-26 10:23:33
这不是Terragrunt的工作方式。Terragrunt能够实例化TF变量并将值传递到Terraform并读取Terraform的输出。
https://stackoverflow.com/questions/74139667
复制相似问题