AWS Certified Developer – Associate (DVA-C02) — Question 109

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 because querying the instance metadata provides access to the public IPv4 address. Option B is incorrect as user data does not contain this information, while option C provides AMI details, not the instance's public IP. Option D is also incorrect since the hosts file does not store the public IP address.