could you find the instance's public IP address using metadata if it has one?

You can retrieve an EC2 instance’s public IP address from inside the instance by querying the Instance Metadata Service (IMDS), using either IMDSv1 or IMDSv2 depending on your configuration
Пожалуйста, войдите, чтобы спрашивать, отвечать, делиться, ставить лайки и голосовать.