Skip to content

Fix InstanceMetadataRegionFetcher for local zones#3699

Open
halaney wants to merge 1 commit intoboto:developfrom
halaney:ahalaney/fix-region
Open

Fix InstanceMetadataRegionFetcher for local zones#3699
halaney wants to merge 1 commit intoboto:developfrom
halaney:ahalaney/fix-region

Conversation

@halaney
Copy link
Copy Markdown

@halaney halaney commented May 5, 2026

InstanceMetadataRegionFetcher queries latest/meta-data/placement/availability-zone/ and strips the trailing character to derive the region. This works for standard AZs (us-east-1a becomes us-east-1) but breaks for local zones (us-east-1-atl-2a becomes us-east-1-atl-2).

Switch to latest/meta-data/placement/region, which returns the parent region directly. This has been around since0 2020 so it should be ok to use.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

InstanceMetadataRegionFetcher queries latest/meta-data/placement/availability-zone/
and strips the trailing character to derive the region. This works for
standard AZs (us-east-1a becomes us-east-1) but breaks for local zones
(us-east-1-atl-2a becomes us-east-1-atl-2).

Switch to latest/meta-data/placement/region, which returns the parent
region directly. This has been around since[0] 2020 so it _should_ be ok to
use.

[0]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.57%. Comparing base (ee748e4) to head (d7067f7).
⚠️ Report is 182 commits behind head on develop.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3699      +/-   ##
===========================================
- Coverage    92.59%   92.57%   -0.03%     
===========================================
  Files           68       68              
  Lines        15634    15765     +131     
===========================================
+ Hits         14477    14594     +117     
- Misses        1157     1171      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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