A developer deployed an application to an Amazon EC2 instance. The application needs to know the public IPv4 address of the instance. How can the application find this information?
A.
Query the instance metadata from http://169.254.169.254/latest/meta-data/.
B.
Query the instance user data from http://169.254.169.254/latest/user-data/.
C.
Query the Amazon Machine Image (AMI) information from http://169.254 169.254/latest/meta-data/ami/.
A) Correct - Amazon EC2 instances expose instance metadata, which provides information about the instance, such as its public IPv4 address, instance ID, security groups, and more.
A for sure, on EC2 instance we have the possibility to get metadata doing a request to the following private linkç http://169.254.169.254/latest/meta-data/
It's A.
Instance meta-data : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
In them you will find :
« network/interfaces/macs/mac/public-ipv4s : The public IP address or Elastic IP addresses associated with the interface. There may be multiple IPv4 addresses on an instance. »
(from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html)
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
sindra
Highly Voted 2 years, 7 months agosumanshu
Most Recent 4 months, 1 week agorcaliandro
1 year, 10 months agosichilam
2 years, 3 months agodark_cherrymon
2 years, 5 months agoArnaud92
2 years, 6 months ago