How to find the region from within an instance?

0 votes
Is there a way to find the region where my ec2 is running from within an instance?
Mar 26 in AWS by ravi
19 views

1 answer to this question.

0 votes

There is one more way of finding the region within an instance.

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

echo $REGION

us-east-1
answered Mar 26 by esha

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
• 4,090 points
31 views
0 votes
1 answer
0 votes
1 answer

Find region from within an EC2 instance

There is one more way of achieving ...READ MORE

answered Mar 12 in AWS by trisha
32 views
0 votes
1 answer

How to safely upgrade an Amazon EC2 instance from t1.micro to large?

Using AWS Management Console: Right-Click on the instance Instance ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 56,520 points
37 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to change the instance type in AWS?

Using the AWS Console. You can follow ...READ MORE

answered Mar 26 in AWS by Esha
17 views