Is there a way to look up the region of an instance from within the instance?
I\'m looking for something similar to the method of finding the instance id.
At some point since most of these answers have been posted, AWS did the reasonable thing and implemented a new path: latest/meta-data/placement/region.
This means getting the region should be as simple as
REGION="$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/region)"
EDIT: It's also probably worth mentioning that this endpoint was made available in the 2019-10-01 release of the metadata API. Make sure your instance supports that version or later before using this by checking http://169.254.169.254/.