Skip to content

Conversation

ShelbyZ
Copy link
Contributor

@ShelbyZ ShelbyZ commented Jun 23, 2025

Summary

For eu-west-1 region s3:GetBucketLocation returns EU for LocationConstraint which is not currently handled. This change adds a check to convert EU --> eu-west-1.

Fixes #929

Buckets in Region us-east-1 have a LocationConstraint of null. Buckets with a LocationConstraint of EU reside in eu-west-1.

Our code previously had a check for us-east-1 and null but lacked checking for EU. Also added a todo for migrating to s3:HeadBucket (larger effort) as a follow-up.

Testing

Local testing

make debug succeeded: yes
Integ tests succeeded: yes
New tests cover the changes: no

Description for the changelog

Fix init process s3 getBucketLocation issue for eu-west-1 region

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

For eu-west-1 region s3:GetBucketLocation returns EU for
LocationConstraint which is not currently handled. This change adds a
check to convert EU --> eu-west-1.

Fixes aws#929
@ShelbyZ ShelbyZ requested a review from a team as a code owner June 23, 2025 20:32
bucketRegion = "us-east-1"
case "EU":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding unit tests that covers "EU" and a few other regions as well. WDYT?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy for this to be done as a follow up but probably safer to have some form of unit testing for this if possible imo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see about a follow-up PR with added testing as it has become a bit of a mountain to rework the existing method to make it more testable.

@ShelbyZ ShelbyZ merged commit e8e4813 into aws:mainline Sep 4, 2025
@ShelbyZ ShelbyZ deleted the issue-929 branch September 4, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't load init files from S3 in eu-west-1, wrong S3 URL
3 participants