The previous logic assumed that the region could always be determined
by stripping the last character from the Availability Zone. This is no
longer true; for example the Local Zone us-west-2-lax-1a corresponds
to the region us-west-2.
Read the region directly from the instance identity document instead.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
The previous logic assumed that the region could always be determined by stripping the last character from the Availability Zone. This is no longer true; for example the Local Zone us-west-2-lax-1a corresponds to the region us-west-2.
Read the region directly from the instance identity document instead.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.