Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all EC2 instance types in a region or AZ [closed]

While there appear to be a few ways to output and filter some AWSCLI commands into this list, does someone have a nice+easy way to list all EC2 instance types for a specific region?

Or perhaps that list is published in a .json file up in a bucket someplace, maintained by AWS?

I'm simply looking for this sort of output:

t1.micro
t2.nano
t2.micro
t2.small
...
like image 406
Neal Magee Avatar asked Jul 24 '17 14:07

Neal Magee


2 Answers

Well it seems that at least one programmatic way to do this is to query the AWS Pricing API:

#!/bin/bash

curl https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json | jq -r '.products[].attributes["instanceType"]' | sort -u | grep '\.'

A gist for this is here, in case of future tweaks: https://gist.github.com/nmagee/b096e6fadf9ac336da7ffdada43f656a

What this is lacking is grouping/specifying by AWS Region, which can be an important distinction -- not every region has all instance type offerings.

like image 186
Neal Magee Avatar answered Oct 09 '22 01:10

Neal Magee


As Far As I Know, such list is not available and cannot be queried from aws cli.

Even when running the aws ec2 run-instances, the instance-type parameter lists available instance types and refers to aws docs

Others have parsed the data and made it available.

like image 38
Frederic Henri Avatar answered Oct 09 '22 00:10

Frederic Henri