【发布时间】:2023-01-20 23:59:56
【问题描述】:
需要为不同的环境部署创建和选择不同的工作区,在 bash 中我可以做 hack
terraform workspace select $env_name || terraform workspace new $env_name
如果第一个失败,将执行第二个命令
我的问题是如何在钩子之前在 terragrunt 中运行它?
#root/terragrunt.hcl
terraform {
before_hook "workspace" {
commands = ["plan", "apply", "destroy"]
execute = ["terraform", "workspace", "select", local.environment]
}
似乎 terragrunt 无法识别“||”符号
【问题讨论】:
标签: terraform terragrunt terraform-workspace