Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS EC2, command line display instance type

Do you guys know if we can display the EC2 instance type using command line?

Currently, I only have access to the command line of an EC2 instance. Is there a command line that I can type to display the type of instance. eg, p2.8xLarge or g.16x etc.

like image 458
wrek Avatar asked Jul 23 '18 20:07

wrek


People also ask

How do I know my EC2 instance type from command line?

To find an instance type using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . From the navigation bar, select the Region in which to launch your instances. You can select any Region that's available to you, regardless of your location. In the navigation pane, choose Instance Types.

What is EC2 instance type?

Amazon EC2 provides a wide selection of instance types optimized to fit different use cases. Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications.


1 Answers

Yes - you can use the meta-data endpoint to retrieve information about your EC2 instance type via the command line:

> curl http://169.254.169.254/latest/meta-data/instance-type
t1.micro

See this page for more information about the available commands.

like image 192
Adil B Avatar answered Sep 25 '22 08:09

Adil B