Skip to content

Resolve IMDS region from placement/region endpoint#3718

Open
leezu wants to merge 1 commit into
boto:developfrom
leezu:fix-imds-region-local-zone
Open

Resolve IMDS region from placement/region endpoint#3718
leezu wants to merge 1 commit into
boto:developfrom
leezu:fix-imds-region-local-zone

Conversation

@leezu

@leezu leezu commented Jun 2, 2026

Copy link
Copy Markdown

InstanceMetadataRegionFetcher derived the region by querying IMDS placement/availability-zone and stripping the last character. That works for standard AZs (us-east-2a -> us-east-2) but produces an invalid region for Local Zones and Wavelength Zones (us-east-2-sbn-1a -> us-east-2-sbn-1), which breaks endpoint resolution for instances running in those zones.

Query the placement/region endpoint, which returns the true parent region directly, and fall back to the availability-zone heuristic only when that endpoint is unavailable (older or third-party IMDS implementations).

See also aws/aws-cli#10374

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

InstanceMetadataRegionFetcher derived the region by querying IMDS
placement/availability-zone and stripping the last character. That works
for standard AZs (us-east-2a -> us-east-2) but produces an invalid region
for Local Zones and Wavelength Zones (us-east-2-sbn-1a -> us-east-2-sbn-1),
which breaks endpoint resolution for instances running in those zones.

Query the placement/region endpoint, which returns the true parent region
directly, and fall back to the availability-zone heuristic only when that
endpoint is unavailable (older or third-party IMDS implementations).
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.

1 participant