AWS Certified Developer – Associate — Question 56
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?
Answer options
- 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/.
- D. Check the hosts file of the operating system.
Correct answer: A
Explanation
The correct answer is A, as querying the instance metadata at the specified URL provides the public IPv4 address of the EC2 instance. Option B retrieves user data, which does not include the public IP. Option C fetches AMI information, which is unrelated to the instance's current public IP. Option D is incorrect because the hosts file does not contain the public IPv4 address information.