Introducing ec2-instance-selector

Teracloud
2 min readOct 25, 2021

When provisioning a spot fleet, getting the correct instance type can be a little bit overwhelming, log in to the console, look for instance capacity, etc

That’s why AWS provides us a really useful tool from the cli, ec2-instance-selector (https://github.com/aws/amazon-ec2-instance-selector)

This makes our lives much easier. You just need to run the command passing resource criteria like vcpus, network performance, ram, etc.

Be sure to have your AWS credentials loaded when you run it.

Introducing EC2 instance selector

➜ ec2-instance-selector — vcpus=2 — memory=4 — cpu-architecture=x86_64 — gpus=0

c5.large
c5a.large
c5ad.large
c5d.large
t2.medium
t3.medium
t3a.medium

There are lots of filters to use, check it out with — help:

➜ ec2-instance-selector — help

(…)
Usage:
ec2-instance-selector [flags]

Examples:

ec2-instance-selector — vcpus 4 — region us-east-2 — availability-zones us-east-2b
ec2-instance-selector — memory-min 4 — memory-max 8 — vcpus-min 4 — vcpus-max 8 — region us-east-2

Filter Flags:

— allow-list string List of allowed instance types to select from w/ regex syntax (Example: m[3–5]\.*)

-z, — availability-zones strings Availability zones or zone ids to check EC2 capacity offered in specific AZs

— baremetal Bare Metal instance types (.metal instances)

-b, — burst-support Burstable instance types

-a, — cpu-architecture string CPU architecture [x86_64/amd64, i386, or arm64]

— current-generation Current generation instance types (explicitly set this to false to not return current generation instance types)

— deny-list string List of instance types which should be excluded w/ regex syntax (Example: m[1–2]\.*)

-e, — ena-support Instance types where ENA is supported or required

-f, — fpga-support FPGA instance types

(…)

So stop wasting time looking for instance types and give this powerful tool a shot!

Teracloud is an AWS Advanced Consulting Partner specialized in Cloud Computing (AWS, Azure, GCP) best practices. We help SaaS of different industries around the world scale their business safely.

Contact our team at info@teracloud.io for an assessment. Let us handle migration, automation, deployment, performance, cost optimization and machine learning to make your business grow.

We make the cloud easy for you!

--

--

Teracloud

Our thoughts on everything Cloud, Expanding knowledge on our expertise and services