Open peteristhegreat opened 8 months ago
Voting for Prioritization
Volunteering to Work on This Issue
This could be addressed via the use of a region "meta-argument": https://github.com/hashicorp/terraform-provider-aws/issues/25308.
Would also need source_region
on aws_s3_object_copy
.
Terraform Core Version
1.6.6
AWS Provider Version
5.31.0
Affected Resource(s)
aws_s3_object or aws_s3_bucket_object doesn't work with the optional region ap-east-1
Expected Behavior
Accessing s3 buckets in an optional region should work.
Actual Behavior
It throws an error: An error occurred (IllegalLocationConstraintException) when calling the GetObject operation: The ap-east-1 location constraint is incompatible for the region specific endpoint this request was sent to.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Even though these are awscli calls, they are relevant for terraform, since it produces the same error very concisely.
The easiest way to see this happen is to enable an optional region in both your IAM account and in a secondary account, then try some things from the CLI.
The above works.
Try again without the region specifier (assuming your IAM account is not in ap-east-1)
The lack of specifying the region for this s3 bucket breaks the call.
Debug Output
No response
Panic Output
Important Factoids
This has been an odd week of trying to get stuff working in ap-east-1. I've set up a half a dozen other regions in the past and now when working with an "optional" region, and one in china, I am hitting corner cases left and right.
There should be an optional argument to specify the region for awss3* for the region, or have a flag that forces the region argument into the interaction for regions with weird, abnormal geofencing rules.
References
https://github.com/hashicorp/terraform-provider-aws/issues/13638
https://github.com/hashicorp/terraform-provider-aws/issues/31300
https://github.com/aws/aws-cli/issues/8413#issuecomment-1879079322
Would you like to implement a fix?
None