Get a List of All AWS EC2 Instances

Get a List of All AWS EC2 Instances

I have been playing with AWS Pricing API and I wanted to get a list of all avaliable EC2 Instances. I used NuGet package AWSSDK.Pricing

I used GetAttributesValuesRequest() method and set it to return all EC2 instance types. The max number of results is 100 so the code needs to look into the NextToken property and get the next set of results if it exists.

Here is the output:

Note that this is the full list of all EC2 Instances, it is not filtered by a specific region.

Leave a Reply

Your email address will not be published. Required fields are marked *