Skip to content

Conversation

@ubaskota
Copy link
Contributor

@ubaskota ubaskota commented Nov 8, 2024

This PR adds documentation for an issue that results in IllegalLocationConstraintException error when a user tries to create a bucket in a region that's different from the region in their configuration. By default, s3 creates a bucket in us-east-1 if the region isn't defined in LocationConstraint, and if the region in user's configuration isn't set to us-east-1, its throws an error. This PR warns the users about this issue and provides them with options to prevent this.

Copy link
Contributor

@jonathan343 jonathan343 left a comment

Choose a reason for hiding this comment

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

I feel like this warning makes this example confusing for most users following this guide. As a user, I would just want to follow an example that works and worry less about the nuance of creating buckets.

Why don't we simplify the example function to set a default region value ofus-east-1 if not provided by the user? We would eliminate the if region is None conditional and always create the client in the same region as what we set for the LocationConstraint.

Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

LGTM pending any further feedback from Jonathan.

Copy link
Contributor

@jonathan343 jonathan343 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀 Thanks @ubaskota!

@erolclk1
Copy link

Hello @jonathan343 ,@ubaskota ,@nateprewitt.
When do you think you can merge this PR?

@ubaskota ubaskota merged commit 6abe178 into boto:develop Oct 30, 2025
39 checks passed
aws-sdk-python-automation added a commit that referenced this pull request Oct 30, 2025
* release-1.40.63:
  Bumping version to 1.40.63
  Add changelog entries from botocore
  update the documentation for creating s3 bucket to address the region mismatch issue. (#4337)
hssyoo pushed a commit to hssyoo/boto3 that referenced this pull request Nov 25, 2025
… mismatch issue. (boto#4337)

* update the documentation for creating s3 bucket to address the region mismatch issue.
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.

4 participants