Skip to content

Conversation

@tbrand
Copy link

@tbrand tbrand commented Sep 17, 2025

Description

Under the current specification, setting the AWS_REGION environment variable and running agentcore launch results in an error because the region is not properly configured.

The reason AWS_REGION is not being read is that boto3 irregularly reads the AWS_DEFAULT_REGION environment variable instead. The status of environment variables for other CLIs and SDKs is summarized in the following link:

https://stackoverflow.com/questions/59961939/what-is-the-difference-between-aws-default-region-and-aws-region-system-variable

I believe we should align with the AWS standard specification rather than boto3's specific behavior. Therefore, I've made changes so that when AWS_REGION is set, agentcore launch will execute in that specified region.

This change is categorized as a breaking change because if AWS_REGION is unintentionally set, agentcore launch might execute in an unintended region. However, I believe such cases would be rare.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • Unit tests pass locally
  • [-] Integration tests pass (if applicable)
  • Test coverage remains above 80%
  • Manual testing completed

Checklist

  • My code follows the project's style guidelines (ruff/pre-commit)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Security Checklist

  • No hardcoded secrets or credentials
  • No new security warnings from bandit
  • Dependencies are from trusted sources
  • No sensitive data logged

Breaking Changes

List any breaking changes and migration instructions:

If unintended deployment to a different region occurs due to AWS_REGION, you will need to either remove or override the AWS_REGION environment variable. AWS_DEFAULT_REGION remains available for use, but AWS_REGION takes higher precedence.

Additional Notes

N/A

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.

2 participants