我terraform.tfvars
在以下位置有这个文件:
root
|_prod
|_eu-west-2
|_dev
|_terraform.tfvars
|_cognito
|_terragrunt.hcl
它具有以下值:
terragrunt = {
terraform {
extra_arguments "custom_vars" {
commands = [
"apply",
"plan",
"import",
"push",
"refresh"
]
# With the get_tfvars_dir() function, you can use relative paths!
arguments = [
"-var-file=terraform.tfvars"
]
}
}
}
reply_to_email_address = "blah.blah@blah.scot"
我在文档中找不到如何访问它。我试过了get_env
:
include {
path = find_in_parent_folders()
}
terraform {
// double `//` before module are important!
source = "../../../../../terraform-modules//cognito"
}
inputs = {
name = "pvg-online-${local.env}"
reply_to_email_address = get_env("reply_to_email_address", "")
}
但它被设置为默认值""