Briefing Amazon Knowledge

How can software determine the public and private IP addresses of the Amazon EC2 instance that it is

How can software determine the public and private IP addresses of the Amazon EC2
instance that it is running on?

A.
Query the appropriate Amazon CloudWatch metric.

B.
Use ipconfig or ifconfig command.

C.
Query the local instance userdata.

D.
Query the local instance metadata.

Explanation: