Skip to Content

3 ways to check AWS EC2 instance type

If you’re running a business on Amazon Web Services (AWS), then you know that instances are an important part of your infrastructure.

It’s crucial to be able to identify your EC2 instances easily so that you can manage them effectively.

In this blog post, we will discuss three different ways to check your EC2 instance type.

We’ll also provide instructions for how to do it!

Get Your Free Linux training!

Join our free Linux training and discover the power of open-source technology. Enhance your skills and boost your career! Learn Linux for Free!

What is EC2 instance type in AWS?

In Amazon Web Services (AWS), an EC2 instance type refers to a specific configuration of virtual hardware resources for Amazon Elastic Compute Cloud (EC2) instances.

EC2 instance types are categorized based on their characteristics, such as the number of virtual CPUs (vCPUs), the amount of RAM, the type of storage (instance store or Amazon EBS), and the network performance.

AWS offers a wide range of instance types designed to cater to various use cases, from small applications to large-scale enterprise workloads.

Procedure to Check AWS EC2 Instance type

  • Log into EC2 instance with SSH
  • Type curl http://169.254.169.254/latest/meta-data/instance-type and press Enter. This will show you the instance type of your EC2 instance.
  • The output will be in the format of “instance-type: <instance type>”.
  • You can also check the instance type from the AWS console by going to EC2 -> Instances -> Instance Type.

 

Check AWS EC2 Instance type with curl command

The best way to get the AWS EC2 instance type is from the instance metadata.

If you’re logged into your EC instance, then you can get it with the curl command.

Run the following command:

curl 169.254.169.254/latest/meta-data/instance-type

The instance type will be returned in the output.

When an EC2 instance is launched in AWS, it is automatically assigned metadata that provides information about the instance.

This metadata can be accessed using the special IP address 169.254.169.254. By appending the specific path /latest/meta-data/instance-type to this IP address and making a curl request, you can retrieve the instance type of the EC2 instance.

The curl command is a Linux/Unix command line tool that can be used to transfer data between a server and a client.

It can be used to download files, or to send data to a server.

To use the curl command, simply run the following command, followed by the URL of the file or server that you want to connect to:

curl https://www.google.com

This will send a request to Google’s server, and return the HTML of the Google home page.

You can also use curl to send data to a server. To do this, you need to use the -d flag, followed by the data that you want to send. For example:

curl -d "name=John&age=20" localhost:8080/process

This will send the data “name=John&age=20” to the server at localhost:8080, which is assumed to be running a program that can process this data.

The curl command is a very powerful tool, and can be used for many different purposes.

For more information on how to use it, consult the curl documentation.

Check EC2 Instance type Using the AWS CLI

The “aws ec2 describe-instances” command can be used to get the instance type for EC2 in AWS.

Install and configure the AWS CLI on your machine.

Run the following command:

aws ec2 describe-instances --filters Name=private-ip-address,Values=10.1.0.235 --region us-west-2|grep -i Instance

If you prefer to use command-line tools, then you can check your EC instance type using the AWS CLI. Replace the values with the IP address of your EC2 instance in the above command. The instance type will be returned in the output.

The AWS CLI (Command Line Interface) command “aws ec2 describe-instances” is used to retrieve information about EC2 instances in your AWS account.

When you execute this command, it sends a request to the AWS EC2 service to retrieve details about one or more instances. The response will include a JSON-formatted output containing various information about the instances, such as their instance IDs, instance types, state, launch time, network details, attached volumes, security groups, and much more.

This command can be used to get the following information:

  • The instance ID
  • The instance type
  • The public IP address
  • The launch time
  • The termination time
  • The state of the instance

 

The following are two helpful commands for managing AWS instances:

  • aws ec2 describe-instances –instance-ids : Shows the instance with specified instance id
  • aws ec2 terminate-instances –instance-ids : Terminates the specified instance

 

Check EC2 Instance type from the AWS Console

Another way to check your EC instance type is from the AWS console. To do this, simply follow these steps:

Login to your AWS account and go to the EC dashboard.

Select the “Instances” option from the left-hand menu. Find the instance that you want to check in the list of instances.

The instance type will be displayed in the “instance type” column.

That’s it! These are three different ways that you can check your EC instance type.

We hope that this blog post has been helpful. If you have any questions, please feel free to reach out to us on our support forums. Thanks for reading!`;