Unsure how would be able get var.region at runtime since the auto backend creation happens quite early on outside of terraform. Open to suggestions and PRs. No sweat either way of course. Hope that helps.
So my bucket with the state is within eu-west-2 but my resource for this environment needs to be built in eu-west-1.
When I run:
AWS_REGION=eu-west-1 TS_ENV=new-schema terraspace plan ecs
I get:
Building .terraspace-cache/eu-west-1/new-schema/stacks/ecs
Built in .terraspace-cache/eu-west-1/new-schema/stacks/ecs
Current directory: .terraspace-cache/eu-west-1/new-schema/stacks/ecs
/Users/nickpocock/.gem/ruby/2.6.0/gems/aws-sdk-core-3.131.1/lib/seahorse/client/plugins/raise_response_errors.rb:17:in `call': **The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. (****Aws::S3::Errors::PermanentRedirect****)**
The reported error is Aws::S3::Errors::PermanentRedirect
I think its potentially ignoring my hardcoded eu-west-2 for my bucket and overwriting it with the AWS_REGION env var, is there a way around this?
That should remove the Aws::S3::Errors::PermanentRedirect error and allow you to use a s3 bucket backend in a different region than where your resources are being provisioned.
Note: Hope to be releasing terraspace_plugin_aws 0.4.x very soon with some improvements to the generated backend.tf defaults.
Note: Released terraspace_plugin_aws 0.4.0 with some updates on the generated backend.tf. Updated upgrading docs with some notes: Upgrading Guide - Terraspace
RE: Do you have a list of first-time issues or something to work on?