所以我有一组大约 30 个输入,在所有项目之间共享。我想知道在所有 terragrunt.hcl 文件中共享它们的最佳方式,而不必将它们复制到一百万个不同的地方。我目前使用 yaml 文件进行一些覆盖。我想知道最佳实践是什么。
locals {
manager = "devops" # default contact
company_id = "moos3" # any string to identify the company for better resources naming. Keep max size of five chars.
default_yaml_path = find_in_parent_folders("empty.yaml") # terragrunt function. read the file content for better explanation.
enabled_api_services = [ # APIs enabled by default for all projects when created
"compute.googleapis.com",
"cloudkms.googleapis.com",
"cloudresourcemanager.googleapis.com",
"logging.googleapis.com",
"monitoring.googleapis.com",
"serviceusage.googleapis.com",
"storage-api.googleapis.com",
]
gcp_billing_account = "*****************" # gcp billing account where projects will be created
gcp_org_id = "*****************" # gcp organization id where resources will be created
gcp_seed_project_id = "my-seed" # initial seed project where terraform state bucket will be created
region = "us-east1" # default region for shared services
stack = "global" # architectural stack name
}
最好只包含一个模块来包含这些或从集中路径加载它们。因为这些东西不会经常改变。