I want to write a script which uses the AWS api within an EC2 instance to modify its own configuration, however to use the aws
command I need to provide a AWS_DEFAULT_REGION
environment variable with the correct region (i.e. 'us-east-1').
If I simply want to issue command pertaining to the instance itself, how can I discover which region to use without hard-coding it in? I looked through the instance metadata documentation and couldn't find a solution.