I am on terraform 0.11.15 and working to upgrade to 1.x now.
My state is stored in a S3 bucket.
Currently I deploy doing the following:
Clear stale modules & remote state, then re-initialize
rm -rf .terraform terraform.tfstate*
terraform init \
-backend-config="bucket=${S3_BUCKET_KEY}" \
-backend-config="key=terraform/state"
terraform plan \
-var="image_tag=\"${GIT_COMMIT}\"" \
-var-file="${S3_BUCKET_KEY}.tfvars" \
-out="${S3_BUCKET_KEY}.tfplan"
terraform apply "${S3_BUCKET_KEY}.tfplan"
My question is, can I perform my terraform state upgrade by pulling in the current 0.11.15 state from S3, update it locally and then save it to a different S3 bucket?
If so, what steps should I take to do that?
Does running apply
push the updated state file to S3 automatically?