-
Notifications
You must be signed in to change notification settings - Fork 840
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception when using ARN of the bucket #2244
Comments
@zoewangg Is this a valid issue? |
I am having the same exact issue. Any updates on this? |
Agree, this is still an issue in SDK 2.16.34 |
Hi everyone, I'm sorry for the delay in response. The scope of the
That's why you see an error when using a standard bucket ARN. Access Point ARNs use the format In addition, Access Point ARNs are not compatible with all S3 operations, see the list of the supported operations here: All that said, @rmunna: I've tested your sample code without the
It doesn't work when I use |
So I responded my own question in my previous comment, ARN inputs are only supported when using S3 Access Points, regular bucket ARNs are not supported. We'll work to make the error message more clear in this case. |
Hi @debora-ito Below code S3Client s3Client = S3Client.builder().region(Region.US_EAST_1) .credentialsProvider(StaticCredentialsProvider.create(AccessDetails.getV2AwsCredentials())).build(); throw a 400 error software.amazon.awssdk.services.s3.model.S3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-southeast-1' (Service: S3, Status Code: 400) Am I missing anything here? BR |
Hi @dhivakarcs, We also hit this issue and were finally able to fix it using a suggestion I found in another github issue. If you specify both region and endpoint override when building the client and set them to consistent values, the getBucketLocation call will work. Intuitive right? Sample code:
|
I am trying to create s3client which works for cross regions by enabling
useArnRegionEnabled
flag and by passingarn
of the bucket as suggested here . S3Client is created with region us-west-1 and the bucket is in us-east-2.But the sdk is throwing the following error
Bucket ARN is copied from the S3 console
Your Environment
The text was updated successfully, but these errors were encountered: