I am attempting to run TS_ENV=test terraspace all plan
However it seems to be setting the environment as new-schema
(my previous TS_ENV) even though I’m passing the TS_ENV var as test.
terraspace plan s3: │ Error: error reading S3 Bucket (54dd-mirror-new-schema-avatar): BucketRegionError: incorrect region, the bucket is not in ‘eu-west-2’ region at endpoint ''
Here is my S3 resource code
locals {
buckets = {
avatar = {
versioning = false
}
}
}
resource "aws_s3_bucket" "main" {
for_each = local.buckets
bucket = "54dd-${local.prefix}-${each.key}"
}
It should be creating the local.prefix
from the Terraform environment within my locals.tf
prefix = "mirror-<%= Terraspace.env %>"
However it doesn’t seem to be fetching the TS_ENV I pass in