Introduction:

In this article, We have to learn, how to get instance-id, instance-type, Public key, and Security groups name on an AWS server without AWS console login credentials.

Prerequisite:

  1. AWS ubuntu Instance
  2. Sudo access (or) root access for the instance

Step1:

Login to the Instance with Sudo or root access

Step2:

Update and install curl on the instance/server with the below command.

$ sudo apt update
$ sudo apt install curl

Step3:

To view the AWS instance id on Server/instance. Run the below command.

$ curl http://169.254.169.254/latest/meta-data/instance-id

Step4:

To view the AWS instance type on server/instance.

$ curl http://169.254.169.254/latest/meta-data/instance-type

Step5:

To view the AWS public keys which are using instance.

$ curl http://169.254.169.254/latest/meta-data/public-keys

Step6:

To view the AWS security group name which is using instance.

$ curl http://169.254.169.254/latest/meta-data/security-groups

Note:

169.254.169.254 IP is unique for all ubuntu servers.

Leave a Reply