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

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.