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

谁说我不能喝 提交于 2019-12-01 06:18:44

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.

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.

As others have pointed out, this is not something you can just get out of an AWS API endpoint.

So to fill this gap, I've built a general module for dealing with this issue.

I hope this helps for a variety of use cases: https://gist.github.com/mrsiesta/0e4fac21c0eb0e8977e1de7b5277e63b

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!