-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to upload S3 file with Multi-region access point #22494
Comments
Hey @JulioMakita 馃憢 Thank you for taking the time to file this issue. In reviewing, I believe I've come up with a solution that may work for you. A lot of this came from this helpful AWS document. According to the document:
What this means is that you'll likely want to set up bucket replication (as discussed in the document) to ensure that all buckets have the same objects. This can be achieved by setting the Once the bucket objects are being replicated, you could then use the |
Hi @justinretzolk Thank you for your reply. |
Hey @JulioMakita 馃憢 I took another look and realized I'd overlooked an important thing here. Looking at the
With that in mind (and the fact that you're able to do this via the AWS CLI, and the documentation online seems to indicate that this is possible), it seems like supplying the multi-region access point ARN should work, but the errors that you're seeing are coming from AWS, so it seems like this may be an upstream bug. I'm going to tag it as such so that we can take a deeper look into this as time permits. |
This problem still exists, even on the latest provider (4.66.1) |
Community Note
Terraform CLI and Terraform AWS Provider Version
TF CLI - 1.1.3
AWS Provider - 3.71.0
Affected Resource(s)
aws_s3control_multi_region_access_point
aws_s3_bucket_object
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Expected Behavior
Terraform should upload file when a S3 multi-region access point is passed.
Actual Behavior
S3 multi-region access point cannot be used. Terraform is complaining the region is not set.
However, multi-region access point does not have a region.
aws_s3_bucket_object.examplebucket_object: Creating... Error: Error uploading object to S3 bucket (arn:aws:s3::111111111111:accesspoint/my8ka9d9aaaa7.mrap): InvalidARNError: invalid ARN caused by: invalid Amazon s3 ARN, region not set, arn:aws:s3::111111111111:accesspoint/my8ka9d9aaaa7.mrap
I tested using the following command in aws cli. it worked well.
aws s3api put-object --bucket arn:aws:s3::111111111111:accesspoint/my8ka9d9aaaa7.mrap --key test.txt --body test.txt
Steps to Reproduce
Create a S3 multi-region access point. I created using
aws_s3control_multi_region_access_point
resource.It will generate a new global Amazon Resource Name (ARN).
Upload a file into S3 Bucket using
aws_s3_bucket_object
resource.add multi-region access point ARN as bucket name.
References
https://docs.aws.amazon.com/AmazonS3/latest/userguide/MultiRegionAccessPointRequests.html
The text was updated successfully, but these errors were encountered: