[英]Development, Staging and Production environments in serverless solutions (AWS)
[英]How can I separete environments (dev, prod, staging) in AWS using terraform?
我正在使用工作区来分隔 AWS 中的环境:
terraform init
terraform workspace new dev
terraform workspace select dev
terraform validate --var-file $(terraform workspace show).tfvars
terraform apply --var-file $(terraform workspace show).tfvars
命令$(terraform workspace show).tfvars
用于 select as --var-file
与工作区同名的文件,在这种情况下,将使用dev.tfvars
。
有更好的选择吗?
在我的团队中,我们决定遵循每个文件夹的环境模式,类似于 Terragrunt 推荐的模式https://github.com/gruntwork-io/terragrunt-infrastructure-live-example
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.