EC2 instance types and AMIs

Beginner · 19 min

Read an instance type name, choose a family, size and processor, understand burstable credits, and launch from Amazon Machine Images you can trust.

Before thisRegions, endpoints, ARNs and service scopeVPCs, subnets and address planning

AWS Events · 19 min

EC2 instance types and AMIs

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by AWS EventsReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • An instance type name encodes the family, generation, options and size: c7gn.xlarge is compute optimized, seventh generation, Graviton, network enhanced.
  • Choose the family by the resource that runs out first: CPU, memory, disk, network or accelerator. Then measure and resize.
  • Graviton instances use Arm processors, so images and binaries must be built for arm64.
  • T instances earn CPU credits below a baseline and spend them above it. Recent T types start in unlimited mode, which can add charges.
  • An AMI is a Regional template with a root disk image, block device mapping and architecture. Copy it to use it in another Region.
  • Look up current AMI IDs through a public SSM parameter and patch by replacing images, not by trusting an old ID.

Renting a machine

Amazon EC2 rents you virtual machines, called instances. Before one can start you must answer two questions: what hardware, and what is on the disk? The first is the instance type, the second the AMI.

Reading the menu

There are many hundreds of types, which looks hopeless until you can read the names.

c 7 g n . xlarge
| | | |     └ size
| | | └ option: network optimized
| | └ option: AWS Graviton processor
| └ generation
└ series: compute optimized
Series Built for
m general purpose, a balance
c CPU-heavy work
r, x, u memory-heavy work, databases, caches
i, d lots of local disk
t small, mostly idle workloads
p, g, inf, trn GPUs and machine learning accelerators

Option letters include a (AMD), i (Intel), g (Graviton), d (local disks), n (network) and flex variants. Within a family, each size step usually doubles vCPUs, memory and price. On x86 a vCPU is commonly one hardware thread; on Graviton it is a whole core, so don’t compare counts blindly.

$ aws ec2 describe-instance-types --instance-types t3.micro m7g.large
  arm64   | burstable: False | 8192 MiB | m7g.large | 2 vCPU
  x86_64  | burstable: True  | 1024 MiB | t3.micro  | 2 vCPU

Choose by asking what runs out first. Start with m in a current generation, watch CPU and memory, then move. Newer generations usually give more work per dollar. Graviton is often cheaper for the same work, if your software builds for arm64.

Two habits keep the choice from becoming a guess. Load test with something that resembles real traffic, because synthetic CPU loops say little about a web service waiting on a database. And treat the type as a setting you revisit: changing it means stopping the instance, editing it and starting again, or, for a fleet, publishing a new template and replacing instances. Not every type is offered in every zone, so list more than one acceptable type where you can.

Burstable instances

T instances share hardware on a deal. Each size has a baseline, a fraction of a vCPU’s time: 10% per vCPU for t3.micro. Below it you earn CPU credits, above it you spend them, like a phone plan that rolls over unused minutes.

What happens with an empty balance depends on the mode. In standard, you are held to the baseline and the server feels broken. In unlimited, the default for current T types (T3 onwards), it keeps running fast and you pay for surplus credits if the 24-hour average stays above baseline. Neither is wrong; know which you have.

AMIs: what boots

An Amazon Machine Image holds what an instance starts from: a root volume image (usually EBS snapshots), a block device mapping describing the disks, plus architecture and boot mode. An AMI belongs to one Region and has a different ID in each. Copy it to use it elsewhere, and grant launch permissions to share it with other accounts.

Sources are AWS (Amazon Linux, and others), operating system vendors, the Marketplace and yourself. Anyone can publish a public AMI, so check the owner before trusting one. Allowed AMIs is an account setting that restricts which publishers can be used.

Don’t paste an ID from a tutorial. Read the current one from a public parameter:

aws ssm get-parameter \
  --name /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64 \
  --query Parameter.Value --output text

Use Amazon Linux 2023 for new work. Amazon Linux 2 reached end of support on 30 June 2026 and no longer receives standard security updates.

Baking your own

Configure an instance once, create an image from it, and every new instance starts ready. The trade is speed of startup against keeping images current. Golden images and immutable infrastructure covers the practice; EC2 Image Builder automates the pipeline on AWS.

Images age. Rebuild on a schedule, deprecate old ones so they drop out of normal listings, and deregister those no longer needed. Remember the snapshots behind an AMI, which are stored and billed separately.

About the video

The embed is AWS’s re:Invent 2025 session “How well do you know EC2?”, 19 minutes. Its description covers the range of instance categories, processor choices including Graviton, and the Nitro System. It has no chapters, and nothing in its description covers AMIs, which the text handles. I judged it from the description only, since transcripts couldn’t be fetched. Stephane Maarek’s older, shorter video in deeper covers families and burstable credits.

What was run: the instance type query ran against moto, a local emulator; I trimmed its table into lines, and its catalogue is a static copy. The SSM lookup’s value there is not a real AMI. Naming, baselines, credit modes and dates are from AWS documentation, checked in November 2026.

Where this fits

You know what to launch. Next, how to start it and get a shell safely: launching and connecting to instances.

Check yourself

  1. 01What can you tell from the name r7gd.2xlarge?

    Memory optimized (r), seventh generation, Graviton processor (g), with local instance store volumes (d), size 2xlarge.

  2. 02A t3.micro web server is fine all morning, then the bill shows extra CPU charges. How?

    It runs in unlimited mode. Averaging above the baseline over 24 hours, it spent surplus credits, which are charged. Use a fixed-performance type or a larger size if the load is steady.

  3. 03Your launch script works in eu-west-1 and fails in us-east-1 saying the AMI does not exist. Why?

    AMI IDs are Regional. Look up the ID per Region, for example through the public SSM parameter, or copy your own AMI there.

  4. 04You move a service to a Graviton instance and it will not start, reporting an exec format error. What is wrong?

    The binary or container image was built only for x86_64. Build for arm64 as well.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark