我正在尝试使用terraform中的工作区创建env特定的部署。它按照预期工作,比如创建env特定的状态。看起来像是
terraform.tfstate.d
|
---- DEV
|
-----terraform.tfstate
|
---- STAG
|
-----terraform.tfstate如何将terraform.tfstate.d的名称更改为env
发布于 2019-10-15 10:56:11
@骷髅可以通过使用“本地”后端来提供不同的名称:
terraform {
backend "local" {
path = "relative/path/to/terraform.tfstate"
}
}https://www.terraform.io/docs/backends/types/local.html
供参考:
https://shinglyu.com/web/2019/04/06/switching-between-multiple-local-backend-in-terraform.html
https://www.terraform.io/docs/backends/index.html
https://medium.com/@jessgreb01/how-to-terraform-locking-state-in-s3-2dc9a5665cb6
https://stackoverflow.com/questions/58216808
复制相似问题