EC2 instances, AMIs and instance families
What is an EC2 instance?
Amazon Elastic Compute Cloud (EC2) lets you rent computing capacity. An instance is a running or allocated compute environment, commonly a virtual machine with an operating system. Imagine a small bookstore whose report generator needs a Linux computer for a few hours. EC2 supplies the computer; you still need to deploy the program, configure access, patch the guest OS and arrange backups. EC2 alone is not a complete website or a managed database.
Image versus machine size
An Amazon Machine Image (AMI) describes the initial software and boot configuration, including the root storage mapping. An instance type describes compute resources such as virtual CPUs (vCPUs), RAM and networking capabilities. RAM holds working data temporarily; vCPUs execute instructions and are not necessarily equivalent to physical cores. A single compatible AMI can launch multiple independent instances. Editing a file on one instance does not automatically update the source AMI. AMIs are regional; check the region, publisher, architecture, boot compatibility and maintenance status before selecting one.
Choose resources for a workload
General-purpose families balance resources; compute-optimized families suit CPU-heavy tasks; memory-optimized families suit large in-memory datasets. Storage-optimized and accelerated-computing families address other specialized workloads. Burstable types use CPU credits to support bursts above a baseline; depending on credit mode, sustained excess use can be limited or incur extra charges. Start with measured requirements, not the biggest machine. An application compiled only for x86-64 cannot simply run natively on an Arm64 guest. Verify the AMI, application dependencies, regional offering, quotas and price together.
Worked offline selection
Consider these invented machine profiles, not AWS product specifications. A report program requires x86-64, 2 vCPUs and at least 4 GiB RAM. Profile A: x86-64, 2 vCPUs, 4 GiB; B: Arm64, 2 vCPUs, 8 GiB; C: x86-64, 1 vCPU, 2 GiB. Only A meets all three requirements. B has more memory but the wrong architecture; C is too small. In a real lab you would then check actual available types and a trusted supported Linux AMI in the approved region. No cloud request is made here.
Common mistake and practice
Do not assume a bigger instance fixes slow disk access or missing permissions. Determine whether CPU, memory, storage or the network is the bottleneck first. Practice: if the program is rebuilt for Arm64 and needs 6 GiB, select from A, B and C again. B is now the only eligible profile, assuming the stated CPU requirement is unchanged. This checks compatibility, not real-world performance. Next: assemble a secure launch plan.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
EC2 instances, AMIs and instance families — knowledge check
Apply EC2 concepts in fictional offline scenarios.
What does an AMI primarily describe?
A binary needs x86-64 and 4 GiB RAM. Which profile in the lesson meets that and the 2-vCPU requirement?
A program spends most of its time computing numerical results. Which family is a reasonable starting candidate to evaluate?
What should you check before using a burstable type for continuous CPU-heavy work?
You update a file on one EC2 instance. What happens to its original AMI automatically?