Find region from within an EC2 instance

0 votes
Is there a way to look up the region of an instance from within the instance?
Mar 12 in AWS by Shalil
10 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

There is one more way of achieving that:

REGION=`curl http://ip/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}'`

echo $REGION

us-east-1
answered Mar 12 by trisha

Related Questions In AWS

0 votes
1 answer

How can I find out the instance id of an ec2 instance from within the ec2 instance?

On Amazon Linux AMIs you can do: $ ...READ MORE

answered Sep 10, 2018 in AWS by Archana
• 3,770 points
14 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.