Skip to content
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

fix: Prevent external AWS configuration from breaking our boto3 config #249

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

jstlaurent
Copy link
Contributor

Changelogs

  • Explicitly set the region when instantiating a boto3 client, to prevent it from picking one up from some external AWS config

Checklist:

  • [ ]~ Was this PR discussed in an issue? It is recommended to first discuss a new feature into a GitHub issue before opening a PR.~
  • Add tests to cover the fixed bug(s) or the newly introduced feature(s) (if appropriate).
  • Update the API documentation if a new function is added, or an existing one is deleted.
  • Write concise and explanatory changelogs above.
  • If possible, assign one of the following labels to the PR: feature, fix, chore, documentation or test (or ask a maintainer to do it for you).

Boto3 can automatically pick up external configuration for AWS, from various places in the environment: env variables, config files in user directory, etc. This recently caused a problem where it picked up a
region from a user that was not compatible with the Cloudflare R2 bucket we use. Explicitly setting the region when the client is created will avoid this issue in the future.

@jstlaurent jstlaurent requested a review from cwognum as a code owner January 17, 2025 18:54
@jstlaurent jstlaurent added the fix Annotates any PR that fixes bugs label Jan 17, 2025
@jstlaurent jstlaurent self-assigned this Jan 17, 2025
Copy link
Collaborator

@cwognum cwognum left a comment

Choose a reason for hiding this comment

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

Thanks, @jstlaurent ! 🙏

Copy link
Contributor

@mercuryseries mercuryseries left a comment

Choose a reason for hiding this comment

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

Thanks @jstlaurent !

@jstlaurent jstlaurent merged commit 817f3a5 into main Jan 17, 2025
19 checks passed
@jstlaurent jstlaurent deleted the fix/boto3-explicit-region branch January 17, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Annotates any PR that fixes bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants