Reputation: 1624
We have been using s3 to save statefiles, but that's broken with v0.9 and I can't seem to find a neat document to fix this, appreciate any help
With 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
With terraform 0.9, remote config command is gone, I tried following but neither does it pull or push state back to 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
Upvotes: 2
Views: 490
Reputation: 576
One issue preventing the remote state to be properly initiated in our code was using terraform required_version > 0.9.1 within our code:
terraform {
required_version = ">= 0.9.1"
backend "s3" {}
}
A bug was filed (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
Upvotes: 3