4.1
Instances, Families and Naming
What an instance is made of, the instance families and how to read m7g.2xlarge.
22 min Reading + animations
Tip: tap or hover any dotted-underlined term to see what it means.
By the end of this lesson you will be able to
- Explain what an EC2 instance is and list what it is made of: vCPUs, memory, storage, network, operating system and image.
- Name the six instance categories and pick the right one for a workload from the keywords in a question.
- Read any instance type name, such as
m7g.2xlargeorc7gn.xlarge, part by part. - Compare Graviton with Intel and AMD instances, and say what has to change before moving to Graviton.
- Calculate how long a burstable T instance can burst, and choose between standard and unlimited mode.
- Launch an instance from the console and predict what each lifecycle action (reboot, stop, start, terminate) keeps and loses.
#What an EC2 instance is
Amazon EC2 (Elastic Compute Cloud) rents you virtual servers. Each one is called an instance. Like your own computer it has processors, memory, storage and an operating system (Linux, Windows or macOS), but it runs on a physical server, the host, inside an AWS data centre, in an Availability Zone you choose.
EC2 is the classic example of IaaS (Infrastructure as a Service): AWS looks after the building, the hardware and the virtualisation layer; you look after everything from the operating system up (patches, software, data, firewall rules). AWS describes EC2 as “resizable compute capacity”: you can start one server or a thousand within minutes, make one bigger or smaller, and stop paying when you stop using it.
#What an instance is made of
When you launch an instance you decide on each of these parts:
| Part | What you choose | Where it comes from |
|---|---|---|
| vCPUs | How many virtual processors | The instance type |
| Memory (RAM) | How many GiB | The instance type |
| Storage | Network-attached EBS volumes (or network file systems), or instance store disks inside the host | EBS: chosen at launch, can be added later. Instance store: only on some types |
| Network | Bandwidth, a network interface in one subnet, private IP, optional public IP | Bandwidth from the instance type; the rest from network settings |
| Operating system and software | Linux, Windows, macOS, plus anything preinstalled | The image (AMI) you launch from |
| Firewall | Which traffic may reach it | One or more security groups (lesson 4.2) |
| Login | How you will get in | A key pair, Instance Connect or Session Manager (lesson 4.2) |
| First-boot script | Commands to run on first start | User data (lesson 4.3) |
A few of these need a closer look.
vCPU. A vCPU is one virtual processor as the operating system sees it. What sits behind it depends on the processor:
- On most Intel instances and older AMD instances (
m6aand earlier), each physical core runs two hardware threads (hyperthreading), and each thread is one vCPU. So 8 vCPUs are 4 physical cores. - On Graviton instances, and on AMD from the 7th generation (
m7a,c7a,r7aand later), each vCPU is a full physical core.
This is why 8 vCPUs of one family can do more work than 8 vCPUs of another.
Memory is given in GiB (gibibytes, 1,024 × 1,024 × 1,024 bytes), the binary unit, slightly larger than a GB.
Storage comes in two kinds. An EBS (Elastic Block Store) volume is a virtual disk that lives on separate storage servers in the same Availability Zone and reaches the instance over the network. It survives a stop and can be detached and moved. An instance store is an NVMe SSD (or, on some storage types, an HDD) physically inside the host: very fast, but its data is lost when the instance stops, terminates or the host fails. Types that are “EBS-only” have no instance store at all. Chapter 5 covers both in depth.
AMI at a glance. An AMI (Amazon Machine Image) is the template the instance boots from: the operating system, its settings and any software baked in. It is built for one processor architecture (x86 or Arm) and lives in one Region. Lesson 4.3 covers AMIs fully.
What is dedicated and what is shared. The vCPUs, memory and instance store of your instance are reserved for you. The host’s network and EBS bandwidth are shared fairly between the instances on it, which is why smaller types say “up to 12.5 Gbps”: they get a baseline and can burst above it while capacity is free. Larger sizes get fixed, higher figures. Modern instances run on the AWS Nitro System, which moves networking, storage and security work onto dedicated cards so almost all of the host’s processors and memory go to the instances.
What an instance is made of
Your instance is a slice of one physical host. Some parts sit inside that host, others reach it over the network.
Scenario
The instance type m7gd.large reserves 2 vCPUs and 8 GiB of memory on Host A for you alone. Nobody else can use them, even when your instance is idle.
#Instance families
AWS offers hundreds of instance types. They are grouped into six categories, each tuned for one kind of work. Within a category, the first letter of the type name is the series (often called the family).
| Category | Series | Built for | Typical workloads | Memory per vCPU (current series) |
|---|---|---|---|---|
| General purpose | M, T (burstable), Mac | A balance of compute, memory and network | Web and application servers, small and medium databases, code repositories, development and test | M: 4 GiB. T: varies |
| Compute optimised | C | Fast processors, more vCPUs per GiB | Batch processing, media transcoding, high-performance web servers, scientific modelling, dedicated game servers, CPU-based machine-learning inference | 2 GiB |
| Memory optimised | R, X, U (high memory), z1d | Large data sets held in RAM | In-memory caches (Redis, Memcached), in-memory analytics (Apache Spark), large relational and NoSQL databases, real-time processing of big data | R: 8 GiB. X: 16–32 GiB. U: up to 32 TiB in one instance |
| Storage optimised | I, D, H, plus Im/Is | Very fast or very large local disks (instance store) | I: NoSQL databases (Cassandra, MongoDB), transaction-heavy databases, search clusters, caches for in-memory databases. D/H: data warehousing, distributed file systems (Hadoop), log processing | Varies |
| Accelerated computing | P, G, Trn, Inf, F | GPUs, AWS machine-learning chips or FPGAs | P / Trn: training machine-learning models. G / Inf: inference, graphics and video. F: custom hardware logic | Varies |
| HPC optimised | Hpc | Tightly coupled simulations across many nodes | Weather, fluid dynamics, genomics, crash simulation | Varies |
A short mnemonic for the series you will see most often:
- C = Compute / CPU-intensive.
- R = RAM.
- M = Middle of the road: balanced, general workloads.
- T = Turbo: burstable, cheap, for workloads that are usually quiet.
- I = I/O: fast local disks. D = Dense storage.
- P and G = GPUs. Trn = Trainium (training). Inf = Inferentia (inference).
#More detail on each category
- General purpose.
Mgives a steady, balanced machine and is the safe default when you do not know the bottleneck yet.Tis cheaper and burstable (its own section below). Mac instances run macOS on real Apple hardware for building iPhone and Mac apps; they run on a Dedicated Host with a 24-hour minimum allocation. - Compute optimised. Same processors as M, but half the memory per vCPU, so you pay for processor power, not RAM you will not use.
- Memory optimised.
Rfor most memory-hungry work.Xfor very large in-memory databases.U(high memory) for the largest in-memory databases, with up to 32 TiB of RAM in one instance.z1dadds a very high, sustained processor clock for software licensed per core, where fewer, faster cores save licence money. - Storage optimised. The point is the local instance store.
Itypes have NVMe SSDs with very high random read/write speed and very low latency.DandHtypes have large hard disks for cheap sequential throughput. Because the data lives on instance store, the software must copy or replicate it (Cassandra, MongoDB and Hadoop do this themselves). - Accelerated computing. Hardware accelerators work alongside the processors: GPUs (
P,G), AWS-designed machine-learning chips (Trn,Inf), and FPGAs that you program with your own hardware logic (F). - HPC optimised.
Hpctypes are built for large simulations where hundreds of nodes exchange data constantly. They come with very fast networking between nodes and are available in fewer Regions. Placement groups for these clusters are in lesson 4.5.
#Reading an instance type name
Every instance type name has the same shape: series, generation, options, a dot, size.
| Part | In m7g.2xlarge | Meaning |
|---|---|---|
| Series | m | General purpose |
| Generation | 7 | Seventh generation. Higher is newer, and usually faster and cheaper for the same work |
| Options | g | Processor and extra capabilities (zero or more letters) |
| Size | 2xlarge | How big this instance is within its family |
The options letters you need to know:
| Letter | Meaning | Example |
|---|---|---|
g | AWS Graviton processor (Arm) | m7g, c8g |
i | Intel processor | m7i, c7i |
a | AMD processor | m7a, c7a |
d | Local NVMe instance store included | m7gd, c6id |
n | Higher network (and EBS) bandwidth | c7gn, m6in |
b | Higher EBS (block storage) performance | r5b |
e | Extra memory, extra storage or extra GPU memory, depending on the category | x2iedn, i3en |
z | High processor clock speed | m5zn, r7iz |
flex | Flex instance, a cheaper variant (written with a hyphen) | m7i-flex, c7i-flex |
Two quirks: the a series (the old a1 type) also meant Graviton, and the u high-memory types put their memory in the name, such as u7i-12tb.
Sizes double. Within a family each step up doubles vCPUs, memory and the price:
| Size | m7g vCPUs | m7g memory |
|---|---|---|
| medium | 1 | 4 GiB |
| large | 2 | 8 GiB |
| xlarge | 4 | 16 GiB |
| 2xlarge | 8 | 32 GiB |
| 4xlarge | 16 | 64 GiB |
| 8xlarge | 32 | 128 GiB |
| 16xlarge | 64 | 256 GiB |
| metal | 64 | 256 GiB, no hypervisor: the whole host |
Smaller sizes exist in some families (nano, micro, small in T). metal gives you the whole physical server with no virtualisation, for software that needs direct hardware access or its own hypervisor.
Same size, different family. Because each category has its own memory-per-vCPU ratio, the same size word means different machines:
| Type | vCPUs | Memory |
|---|---|---|
c7g.2xlarge | 8 | 16 GiB |
m7g.2xlarge | 8 | 32 GiB |
r7g.2xlarge | 8 | 64 GiB |
Some real examples to see how the numbers line up (check the current figures with the commands in “Try it yourself”):
| Type | vCPUs | Memory | Local storage | Network |
|---|---|---|---|---|
t3.micro | 2 | 1 GiB | EBS-only | Up to 5 Gbps |
c7i.4xlarge | 16 | 32 GiB | EBS-only | Up to 12.5 Gbps |
r7g.4xlarge | 16 | 128 GiB | EBS-only | Up to 15 Gbps |
i4i.2xlarge | 8 | 64 GiB | 1 × 1,875 GB NVMe SSD | Up to 12 Gbps |
c7gn.16xlarge | 64 | 128 GiB | EBS-only | 200 Gbps |
Reading an instance type name
Every name is series + generation + options, a dot, then the size. Peel it apart one piece at a time.
Scenario
Start with the whole name. Everything before the dot is the family (m7g); everything after it is the size.
Self-checkQuestion
A team compares c7g.xlarge and c7gn.xlarge. What does the n add?
#Processors: Graviton, Intel and AMD
Most series come with a choice of processor, shown by the options letter:
Graviton (g) | Intel (i) | AMD (a) | |
|---|---|---|---|
| Who designs it | AWS, based on the Arm architecture | Intel (Xeon) | AMD |
| Architecture | Arm 64-bit (arm64) | x86 64-bit (x86_64) | x86 64-bit (x86_64) |
| vCPU | A full physical core | One hyperthread (half a core) | Hyperthread up to the 6th generation; full core from 7a |
| Price | Usually the cheapest per hour of the three | The reference price | Up to the 6th generation about 10% cheaper than Intel; from 7a a little dearer per hour, but each vCPU is a full core |
| Generations | Graviton2 (6g), Graviton3 (7g), Graviton4 (8g), Graviton5 (9g) | 5, 6i, 7i, 8i | 5a, 6a, 7a, 8a |
| Runs | Linux. Not Windows | Linux and Windows | Linux and Windows |
AWS states that Graviton gives up to 40% better price performance than comparable x86 instances, and a Graviton type is typically around 20% cheaper per hour than the Intel type of the same size and generation. It also uses less energy for the same work.
The catch is software. Graviton runs Arm code, so everything on the instance must be built for arm64:
- Code that runs on an interpreter or runtime (Python, Node.js, Java, PHP, Ruby) and most open-source software work as they are.
- Containers need an
arm64or multi-architecture image. - A vendor program shipped only for x86, and any Windows workload, cannot move.
#Burstable T instances and CPU credits
Many servers sit almost idle most of the day and need full speed only now and then: a small website, a development box, a build agent. Paying for full-time processors would waste money. Burstable (T) instances (t2, t3, t3a, t4g, t8i) solve this with a baseline and CPU credits.
- Each size has a baseline: the share of each vCPU it may use all the time, for example 10% for
t3.micro. - One CPU credit = one vCPU at 100% for one minute (or one vCPU at 50% for two minutes, or two vCPUs at 25% for two minutes).
- The instance earns credits at a fixed rate every hour it runs, and spends credits for the CPU it actually uses. Below the baseline it saves the difference; above the baseline it spends its savings.
- Saved credits are capped at 24 hours’ worth of earnings. Beyond that, new credits are thrown away.
| Type | vCPUs | Baseline per vCPU | Credits earned per hour | Most credits it can keep |
|---|---|---|---|---|
t2.micro | 1 | 10% | 6 | 144 |
t3.nano | 2 | 5% | 6 | 144 |
t3.micro / t4g.micro | 2 | 10% | 12 | 288 |
t3.small | 2 | 20% | 24 | 576 |
t3.large | 2 | 30% | 36 | 864 |
t3.xlarge | 4 | 40% | 96 | 2,304 |
The earn rate follows from the baseline: credits per hour = vCPUs × baseline × 60. For t3.micro: 2 × 10% × 60 = 12 credits per hour.
A worked example. A t3.micro with a full balance of 288 credits suddenly runs both vCPUs at 50%. It spends 2 × 50% × 60 = 60 credits per hour and still earns 12, so the balance falls by 48 per hour: 288 ÷ 48 = 6 hours of burst before the balance is empty.
What happens when the balance is empty depends on the credit mode:
| Standard mode | Unlimited mode | |
|---|---|---|
| Credits run out | The CPU is throttled down to the baseline until it earns more | Keeps bursting, spending surplus credits |
| Extra cost | Never | None if the average over a rolling 24 hours stays at or below the baseline (later quiet time pays the surplus back). Above that, a flat extra price per vCPU-hour |
| Default for | t2 | t3, t3a, t4g, t8i |
More details the exam likes:
t2instances in standard mode get a few launch credits to start quickly, and they lose all saved credits when stopped.t3,t3a,t4gandt8ikeep their saved credits for 7 days after a stop.- You can switch modes at any time, on a running or stopped instance.
- CloudWatch shows the credit balance (
CPUCreditBalance) and, in unlimited mode, the surplus spent (CPUSurplusCreditBalance). A balance that keeps dropping to zero is the warning sign. - A T instance that runs well above its baseline all day is the wrong choice in either mode: in standard mode it is slow, in unlimited mode it pays the extra charge and can end up costing more than an
minstance. Move it to a fixed-performance type (M or C).
A t3.micro spending and earning CPU credits
Baseline 10% per vCPU, 2 vCPUs: it earns 12 credits an hour and can save up to 288. One credit = one vCPU at 100% for one minute.
Scenario
Below the baseline it earns 12 credits an hour but spends only 2 × 3% × 60 = 3.6, so the balance grows until it hits the 24-hour cap.
Flex instances (m7i-flex, c7i-flex, m8i-flex, c8i-flex, r8i-flex) are a newer, simpler middle ground: a baseline of 40% CPU, the ability to reach full speed for 95% of the time over a 24-hour window, no credits to manage, and a lower price than the matching non-flex type. They suit general workloads that do not run flat out all day.
#How to choose an instance type
Find the bottleneck
Is the work limited by processor, memory, local disk speed, network, or a GPU? Measure an existing system, or estimate from the software’s documentation.
Pick the category
General purpose if balanced or unknown; C for processor; R/X for memory; I/D for local disk; P/G/Trn/Inf for accelerators; T or flex when it is usually idle.
Pick the processor and generation
Prefer the latest generation you can get in your Region: it is usually faster and cheaper for the same work. Try Graviton if your software runs on Arm.
Pick the smallest size that fits, then measure
Start small, watch CPU and memory in CloudWatch, and resize. AWS Compute Optimizer analyses real usage and recommends right-sized types.
Decide between bigger and more
A bigger instance (scaling up, vertical) has a ceiling and is one point of failure. More instances (scaling out, horizontal) behind a load balancer survive the loss of one. Production designs scale out.
To resize an EBS-backed instance, stop it, change the instance type, and start it. The new type must be compatible: same architecture (x86 ↔ x86, Arm ↔ Arm), and the AMI must have the network and storage drivers that modern Nitro types need. A resize therefore always needs a short downtime; zero-downtime resizing is done by adding new instances and removing old ones.
#Launching your first instance
The console’s Launch an instance page is one form, top to bottom:
Name and tags
Give the instance a name (stored as the tag
Name) and any other tags, such asenv=dev.Application and OS image (AMI)
Pick an operating system, for example Amazon Linux 2023, Ubuntu or Windows Server, and the architecture: 64-bit (x86) or 64-bit (Arm). The architecture you pick limits which instance types you can choose next.
Instance type
Choose a type such as
t3.micro. The console marks Free Tier eligible types:t2.microandt3.microon accounts created before 15 July 2025;t3.micro,t3.small,t4g.micro,t4g.small,c7i-flex.largeandm7i-flex.largeon newer accounts, whose Free Tier works with credits for six months.Key pair (login)
Create or choose a key pair for SSH (Linux) or for decrypting the Windows password. Lesson 4.2 covers key pairs, Instance Connect and Session Manager, which needs no key at all.
Network settings
Choose the VPC and subnet (which decides the Availability Zone), whether to auto-assign a public IP, and the security group: create one, or select existing ones.
Configure storage
Set the root EBS volume’s size and type (gp3 by default), and add more volumes if needed.
Advanced details
Optional settings: an IAM instance profile (role), user data (a first-boot script), termination and stop protection, shutdown behaviour, the purchasing option (On-Demand, Spot), the instance metadata settings, and the credit mode for T instances.
Summary and launch
Choose how many instances to launch and select Launch instance. The instance appears in the list in the
pendingstate.
#The instance lifecycle
An instance moves through a small set of states:
| State | What is happening | Compute billed? |
|---|---|---|
pending | AWS picks a host, attaches the volumes and network, boots the AMI | No |
running | Ready for use | Yes |
stopping | Shutting down before a stop | No (yes if it is hibernating) |
stopped | Off. Can be started again, or have its type changed | No, but EBS volumes and public IPv4 addresses (including Elastic IPs) still cost money |
shutting-down | Preparing to be terminated | No |
terminated | Deleted for good. Stays visible in the list for a short while, then disappears | No |
A reboot is not a state of its own: the instance stays running on the same host, like restarting your computer.
What each action keeps and loses:
| Reboot | Stop, then start | Terminate | |
|---|---|---|---|
| Host | Same host | Usually a new host | Gone |
| Private IP | Kept | Kept | Released |
| Auto-assigned public IPv4 | Kept | Released; a new one on start | Released |
| Elastic IP | Kept | Stays associated (and billed while stopped) | Disassociated, but stays in your account and keeps billing until released |
| EBS root volume | Kept | Kept | Deleted by default (Delete on termination = on) |
| Other EBS volumes | Kept | Kept | Kept by default (Delete on termination = off) |
| Instance store data | Kept | Lost | Lost |
| RAM contents | Lost (the operating system restarts) | Lost (unless hibernating, lesson 4.5) | Lost |
| Billing | Continues | Compute stops while stopped. Linux is billed per second with a 60-second minimum each time it starts | Stops |
The instance lifecycle
Launch, reboot, stop and start, terminate: watch what each action keeps and what it throws away.
Scenario
Instance i-0a1b2c3d
| What | Now |
|---|---|
| State | pending |
| Host | A |
| Private IP | 10.0.1.25 |
| Public IP | — |
| Instance store | empty |
| Billing | compute stopped |
You launch the instance. In pending, EC2 picks a host, creates the root volume from the AMI and attaches the network. You are not billed yet.
Settings that protect you from mistakes:
- Termination protection blocks terminate from the console, CLI and API. It does not stop Auto Scaling from terminating an instance (use scale-in protection for that), and it does not apply when the operating system shuts itself down with shutdown behaviour set to terminate.
- Stop protection does the same for stop.
- Shutdown behaviour decides what a shutdown from inside the instance (
sudo shutdown -h now) does: stop (the default) or terminate. - An instance whose root volume is an instance store (only some old AMIs) cannot be stopped: it can only reboot or terminate.
#What goes wrong
| Symptom | Cause | Fix |
|---|---|---|
Launch fails with InsufficientInstanceCapacity | AWS has no spare capacity of that type in that Availability Zone right now | Try another Availability Zone or a similar type, try again later, or reserve capacity in advance with an On-Demand Capacity Reservation (lesson 4.4) |
Launch fails with VcpuLimitExceeded | Your account’s quota of running vCPUs for that group of families in this Region is used up | Request a quota increase in Service Quotas, or stop instances you do not need |
| Type not offered in the chosen Availability Zone | Not every type exists in every Availability Zone or Region, especially new or specialised ones | Check with describe-instance-type-offerings, then pick another subnet or type |
| Cannot select a type, or it will not start, after choosing an AMI | The AMI’s architecture does not match (x86 AMI on Graviton, or the reverse) | Use an AMI built for that architecture |
Instance goes from pending straight to terminated | An EBS volume could not be created or attached: an encrypted volume whose encryption key you are not allowed to use, a volume quota reached, or a damaged snapshot | Read the state reason in describe-instances, fix the key permission or quota |
| A T instance becomes slow after busy hours, CPU flat at baseline | CPU credits used up in standard mode | Unlimited mode, or a fixed-performance type |
| Public IP changed after maintenance | The instance was stopped and started | Use an Elastic IP, or better, a load balancer or DNS name |
#How it is used in system design
| Requirement in the question | Choose |
|---|---|
| Full control of the operating system, long-running processes | EC2 |
| Balanced web or application server, unknown bottleneck | General purpose M |
| Small site or dev box, mostly idle with short spikes | Burstable T (or flex) |
| Batch jobs, video encoding, game servers, high-traffic web servers | Compute optimised C |
| In-memory cache or database, Apache Spark, big heaps | Memory optimised R / X (largest: U) |
| Very high random disk speed on local NVMe, NoSQL with its own replication | Storage optimised I |
| Huge sequential local disks, data warehouse, Hadoop | Storage optimised D / H |
| Train machine-learning models | P (GPU) or Trn (Trainium) |
| Machine-learning inference, graphics rendering, video streaming | G or Inf |
| Custom hardware logic | F (FPGA) |
| Tightly coupled simulation across many nodes | Hpc (with a cluster placement group, lesson 4.5) |
| Lower cost for software that runs on Arm | Graviton (g) types |
| Software licensed per physical core | Fewer, faster cores (z, or reducing active cores in CPU options) and Dedicated Hosts (lesson 4.4) |
#Try it yourself
# What is an m7g.2xlarge? vCPUs, memory, architecture, network
aws ec2 describe-instance-types --instance-types m7g.2xlarge \
--query "InstanceTypes[].{Type:InstanceType,vCPU:VCpuInfo.DefaultVCpus,MemMiB:MemoryInfo.SizeInMiB,Arch:ProcessorInfo.SupportedArchitectures,Net:NetworkInfo.NetworkPerformance}" \
--output table
# All current-generation Graviton types with local instance store
aws ec2 describe-instance-types \
--filters Name=processor-info.supported-architecture,Values=arm64 \
Name=current-generation,Values=true \
Name=instance-storage-supported,Values=true \
--query "InstanceTypes[].InstanceType" --output text
# Every burstable type in this Region
aws ec2 describe-instance-types --filters Name=burstable-performance-supported,Values=true \
--query "sort(InstanceTypes[].InstanceType)" --output text
# Which Availability Zones offer c7gn.xlarge?
aws ec2 describe-instance-type-offerings --location-type availability-zone \
--filters Name=instance-type,Values=c7gn.xlarge --output table
# Latest Amazon Linux 2023 AMI for Arm, then launch a t4g.micro in standard credit mode
AMI=$(aws ssm get-parameter --name /aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64 \
--query Parameter.Value --output text)
ID=$(aws ec2 run-instances --image-id $AMI --instance-type t4g.micro \
--credit-specification CpuCredits=standard \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=first-instance}]' \
--query "Instances[0].InstanceId" --output text)
# Watch the state, then protect it from termination
aws ec2 describe-instances --instance-ids $ID --query "Reservations[].Instances[].State.Name"
aws ec2 modify-instance-attribute --instance-id $ID --disable-api-termination
# Switch to unlimited mode, then resize: stop, change type, start
aws ec2 modify-instance-credit-specification \
--instance-credit-specifications "InstanceId=$ID,CpuCredits=unlimited"
aws ec2 stop-instances --instance-ids $ID && aws ec2 wait instance-stopped --instance-ids $ID
aws ec2 modify-instance-attribute --instance-id $ID --instance-type "{\"Value\": \"t4g.small\"}"
aws ec2 start-instances --instance-ids $ID
# Clean up: remove protection, then terminate
aws ec2 modify-instance-attribute --instance-id $ID --no-disable-api-termination
aws ec2 terminate-instances --instance-ids $ID
#Summary
Key takeaways
- EC2 rents virtual servers (IaaS): you choose vCPUs, memory, storage, network and an AMI, and manage everything from the operating system up.
- vCPU: one hyperthread on Intel and older AMD; a full core on Graviton and AMD
7aonwards. Memory is in GiB. - EBS is network storage that survives a stop; instance store is a fast local disk that loses its data on stop, terminate or host failure.
- Six categories: general purpose (M, T), compute (C), memory (R, X, U), storage (I, D, H), accelerated (P, G, Trn, Inf, F), HPC (Hpc). Machine-learning training is P or Trn, not C.
- Name = series + generation + options . size:
m7g.2xlargeis general purpose, 7th generation, Graviton, 8 vCPUs. Options:gGraviton,iIntel,aAMD,dinstance store,nnetwork,eextra,zhigh clock. Each size step doubles. - Graviton is cheaper for the same work but needs
arm64software and an Arm AMI; no Windows; no stop-and-change-type from x86. - T instances: 1 credit = 1 vCPU at 100% for 1 minute; earn per hour = vCPUs × baseline × 60; keep up to 24 hours’ worth. Standard mode throttles to baseline; unlimited keeps bursting and charges only if the 24-hour average is above baseline.
t3/t4gdefault to unlimited. - Lifecycle: pending → running → stopping → stopped → (start) → running, or shutting-down → terminated. Billed for compute only while running. Stop/start: new host, new public IPv4, instance store wiped; private IP and EBS kept. Terminate deletes the root volume by default.
- Resize = stop, change type, start, within the same architecture.
Answer on your own first, then read the explanation, even when you got it right.
Self-checkQuestion
A company needs servers on which it can install a custom kernel module, run a process for weeks, and add or remove capacity quickly. Which AWS service fits?
Self-checkQuestion
In the instance type m7g.2xlarge, what does the letter g mean?
Self-checkQuestion
A team runs a 400 GiB in-memory cache that must stay entirely in RAM. Which instance type is the best fit?
Self-checkQuestion
A research team will train a large deep-learning model for several weeks. Which instance family should a solutions architect recommend?
Self-checkQuestion
Which two statements about vCPUs are true?
Choose 2
Self-checkQuestion
A t3.micro has 2 vCPUs and a baseline of 10% per vCPU. How many CPU credits does it earn per hour?
Self-checkQuestion
A t3.micro with a full balance of 288 credits starts running both vCPUs at 50%. Roughly how long can it keep this up before the balance is empty?
Self-checkQuestion
A small website on t3.small (baseline 20%) is fast every morning but very slow each afternoon. CloudWatch shows CPU flat at exactly 20% during the slow hours. The instance uses standard credit mode. What is happening?
Self-checkQuestion
A t3.medium in unlimited mode runs at 80% CPU for one hour after its balance is empty, then is quiet for the rest of the day. Its 24-hour average stays below the baseline. What does the burst cost?
Self-checkQuestion
Which two instance types launch in unlimited credit mode by default?
Choose 2
Self-checkQuestion
An application server runs at 70% CPU around the clock on a t3.large in unlimited mode, and the bill is higher than expected. What should the architect do?
Self-checkQuestion
Which instance category fits a fleet of dedicated multiplayer game servers and a media transcoding pipeline?
Self-checkQuestion
A Cassandra cluster replicates every row to three nodes and needs the highest possible random read and write speed with the lowest latency. Which type suits each node?
Self-checkQuestion
What does the d in m7gd.xlarge tell you?
Self-checkQuestion
m7g.large has 2 vCPUs and 8 GiB of memory. What does m7g.4xlarge have?
Self-checkQuestion
A workload needs 8 vCPUs and about 60 GiB of memory on Graviton. Which type is the closest fit?
Self-checkQuestion
An engineer stops an m7i.large running an x86 Amazon Linux AMI, changes the type to m7g.large and tries to start it. It fails. Why?
Self-checkQuestion
A company wants to cut costs by moving workloads to Graviton. Which two workloads cannot simply move?
Choose 2
Self-checkQuestion
An EC2 instance is rebooted. Which statement is true afterwards?
Self-checkQuestion
An EBS-backed instance with an auto-assigned public IP and an instance store volume is stopped and then started. Which two things happen?
Choose 2
Self-checkQuestion
An instance has been stopped for a month. What is the company still paying for?
Self-checkQuestion
An instance was launched with a root EBS volume, and a data volume was attached later with default settings. The instance is terminated. Which two statements are true?
Choose 2
Self-checkQuestion
A production instance must never be terminated by mistake from the console or CLI. What should be enabled?
Self-checkQuestion
An EBS-backed m7i.large needs more memory. What is the correct way to change it to r7i.large?
Self-checkQuestion
Launching ten c7i.4xlarge instances in us-east-1a fails with the error: ‘We currently do not have sufficient c7i.4xlarge capacity in the Availability Zone you requested.’ What is the most appropriate response?
Self-checkQuestion
A launch fails with the error: ‘You have requested more vCPU capacity than your current vCPU limit allows.’ What does it mean?
Self-checkQuestion
Which action is NOT possible on an instance whose root device is an instance store volume?
Self-checkQuestion
An application performs in-memory big data analysis with Apache Spark on a fleet of EC2 instances. Which instance family should the fleet use?
Self-checkQuestion
A weather simulation runs across 200 nodes that exchange data constantly and need the fastest possible node-to-node networking. Which instance category is designed for this?
Self-checkQuestion
Which of these is NOT one of the EC2 instance categories?
Self-checkQuestion
What do Flex instances such as m7i-flex.large offer compared with T instances?
Self-checkQuestion
A t2.micro in standard mode has saved 140 credits. It is stopped on Friday and started on Monday. What is its saved credit balance after the start?