Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to curl my EC2 instance to get my EC2 instance information

I am trying to follow these Instance Metadata and User Data documentation.

I am trying to curl my EC2 instance but for some reason it give me connection refused. I have allowed incoming requests for HTTP and SSH, and allowed all traffic for outgoing traffic in my security group. I am able to ssh in its but unable to curl.

What am I missing?

like image 248
Tirath Shah Avatar asked Mar 11 '23 13:03

Tirath Shah


1 Answers

The Amazon EC2 instance metadata service is available from within the Amazon EC2 instance itself, via this URL:

curl http://169.254.169.254/latest/meta-data/
like image 185
John Rotenstein Avatar answered Apr 08 '23 14:04

John Rotenstein