terraform v0.9 - s3 后端,语法问题

terraform v0.9 - s3 backend, syntax issue

我们一直在使用 s3 来保存状态文件,但是 v0.9 已经损坏了,我似乎找不到一个简洁的文档来解决这个问题,感谢您的帮助

使用 v0.8

terraform remote config \
-backend=s3 \
-backend-config="bucket=tf-state" \
-backend-config="key=terraform.tfstate" \
-backend-config="region=eu-west-1" \
-backend-config="acl=bucket-owner-full-control" \
-backend-config="encrypt=1"
terraform remote pull
terraform get
terraform apply
terraform remote push

使用 terraform 0.9,远程配置命令消失了,我尝试了以下操作,但它既没有将状态拉回或推回 s3

terraform9x init \
-backend=true \
-backend-config="bucket=tf-state" \
-backend-config="key=terraform.tfstate" \
-backend-config="region=eu-west-1" \
-backend-config="acl=bucket-owner-full-control" \
-backend-config="encrypt=1" \
-get=true \
-input=false \
-force-copy
terraform9x remote pull
terraform9x get
terraform9x apply
terraform9x remote push

阻止远程状态在我们的代码中正确启动的一个问题是在我们的代码中使用 terraform required_version > 0.9.1:

terraform {
  required_version = ">= 0.9.1"
  backend "s3" {}
}

已提交错误(https://github.com/hashicorp/terraform/pull/12942) and it seems to be closed, but based on the comments it is still an open issue: https://github.com/hashicorp/terraform/issues/12971