Lesson 1 of 4 Compute Services

Launching Virtual Servers with Amazon EC2 and Choosing Instance Types

This lesson explains how Amazon Elastic Compute Cloud (Amazon EC2), the most fundamental AWS compute service, provides secure, resizable virtual servers called instances.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the choices made when an instance is launched, such as the AMI and instance type.
  • Distinguish the EC2 instance families and the workloads each suits.
  • Interpret an instance type name such as m7g.large.
  • Explain when Amazon Lightsail is the simpler choice.

Launching an instance

Launching an EC2 instance, a virtual server, involves a few choices. The Amazon Machine Image (AMI) is the template that provides the operating system and any pre-installed software, such as Amazon Linux or Windows Server. The instance type decides how much CPU, memory, storage and network capacity the server has. Storage is usually one or more EBS volumes. A security group acts as the instance's firewall, deciding which traffic may reach it, and a key pair or another method, such as Session Manager, provides access. The following table summarises these choices.

You chooseMeaning
Amazon Machine Image (AMI)The template with the operating system and software, e.g. Amazon Linux or Windows Server
Instance typeThe amount of CPU, memory, storage and networking
StorageEBS volumes
Security groupFirewall rules
AccessA key pair or another access method

You can start, stop and terminate instances at any time and pay for what you run. EC2 is IaaS, so you manage and patch the operating system and installed software.

Match the pairs

Launching an instance

Exam skills 3.3.1

Match each launch choice with what it decides.

Log in to try this activity Interactive activities are free with an account.

Instance families

EC2 instance types are grouped into families, each designed for a kind of workload. General purpose instances balance CPU, memory and networking, and suit everyday workloads such as web servers. Compute optimised instances have powerful processors for CPU-heavy work, such as batch processing, video transcoding, game servers and scientific modelling. Memory optimised instances have large amounts of memory, for in-memory databases and real-time analysis of big data.

Accelerated computing instances add GPUs or other specialised chips, for machine learning, graphics and video. Storage optimised instances have fast local storage for workloads that read and write large amounts of data, such as data warehouses. Exam questions usually describe a workload and ask for the matching family. The following table summarises the families.

FamilyOptimised forExamples
General purposeBalanced CPU, memory and networkingWeb servers, code repositories
Compute optimisedHigh-performance processorsBatch processing, media transcoding, gaming servers, scientific modelling
Memory optimisedLarge data sets in memoryIn-memory databases, real-time big data analytics
Accelerated computingGPUs and other acceleratorsMachine learning, graphics, video
Storage optimisedHigh, low-latency local storage I/OData warehousing, distributed file systems
Sort into groups

Which instance family?

Exam skills 3.3.1

Choose the EC2 instance family for each workload.

Log in to try this activity Interactive activities are free with an account.

Reading instance type names

In m7g.large: m is the family (general purpose), 7 the generation, g an extra attribute (AWS Graviton, Arm-based, often better price performance) and large the size.

Amazon Lightsail

Lightsail offers simple virtual private servers, databases and networking at predictable, low monthly prices, ideal for small websites, blogs, simple web apps and people new to AWS.

Worked example

Choosing an instance family

A company runs several workloads with different resource requirements. The following table identifies the main need of each workload and the instance family that meets it.

WorkloadMain needInstance family
Company website and small application serversBalanced resourcesGeneral purpose (for example m7g)
Encoding thousands of videosRaw processing powerCompute optimised (c family)
An in-memory database holding 500 GBLots of memoryMemory optimised (r or x family)
Training a machine learning modelGPUsAccelerated computing (p or g family)
A data warehouse reading huge files from local diskFast local storageStorage optimised (i family)
A personal blog on a fixed monthly budgetSimplicity and a predictable priceAmazon Lightsail instead of EC2

The instance type name tells you what you are getting: in c7g.xlarge, c is compute optimised, 7 the generation, g means a Graviton processor, and xlarge the size.

Check yourself

What is Amazon Lightsail?

Show answer

A simple service with virtual servers, storage and networking for a predictable monthly price, for small applications and websites.

Exam Tips

Remember for the exam

  • Compute-intensive batch work or gaming servers suit compute optimised instances.
  • In-memory databases and large data sets held in memory suit memory optimised instances.
  • Machine learning and graphics suit accelerated computing instances with GPUs.
  • High local disk I/O suits storage optimised instances.
  • A simple website at a fixed monthly price suits Lightsail.
  • EC2 is IaaS, so you manage the operating system.