AWS Systems Architect Professional

Amazon EC2 Exam Cram: Instances, Storage, Placement, Pricing, and Lifecycle – SAP-C02 Study Guide

Study Amazon EC2 for SAP-C02 with coverage of AMIs, storage, networking, placement groups, lifecycle states, Nitro, pricing, and dedicated tenancy.

AWS Systems Architect ProfessionalAWS Systems Architect ProfessionalUpdated Sep 1, 2026
Study options
WatchComing later
ListenComing later
ReadAvailable
ReviewComing later

Study guide

Technical reference and lesson notes

Purpose of This Lesson

Amazon Elastic Compute Cloud (EC2) provides resizable virtual servers in AWS. For the SAP-C02 exam, EC2 questions commonly test instance lifecycle behavior, AMIs, IP address persistence, placement groups, storage choices, tenancy, pricing models, and the operational responsibilities that come with running infrastructure directly.

Key Concepts

EC2 responsibility model

An EC2 instance gives you control at the operating-system level. You are responsible for tasks such as:

  • Operating system updates and hardening
  • Installed software and application configuration
  • Host-based firewalls and access controls
  • Instance monitoring and recovery procedures
  • Data protection and backups

AWS operates the underlying physical infrastructure, virtualization platform, and availability zone facilities.

AMIs

An Amazon Machine Image (AMI) is a launch template for an EC2 instance. It contains or defines:

  • A template for the root volume
  • Launch permissions
  • Block device mappings for attached EBS or instance store volumes
  • The operating system and software configuration captured in the image

AMIs are regional resources. An AMI stored in one AWS Region cannot be used directly to launch an instance in another Region. Copy the AMI to the target Region before using it there.

Instance metadata and user data

EC2 instance metadata provides information about the running instance, such as its instance identity, network interfaces, and assigned addresses. Applications and agents inside the instance can retrieve metadata through the Instance Metadata Service (IMDS).

User data is supplied when the instance launches and is commonly used to run initialization commands or bootstrap scripts. User data is not the same as metadata: metadata describes the instance, while user data is input provided to configure it.

Use IMDSv2 where possible because it requires session-oriented requests and provides stronger protection against some request-forgery techniques. Avoid placing long-lived secrets in user data because it may be accessible to processes with appropriate instance-level access.

EC2 storage

#### Amazon EBS

Amazon Elastic Block Store provides persistent block storage for EC2. EBS volumes usually remain available when an instance is stopped and are billed according to the provisioned storage and applicable volume characteristics.

The root EBS volume is deleted by default when an instance is terminated, although this behavior can be changed through the volume’s DeleteOnTermination setting. Data volumes can be configured to persist after termination.

#### Instance store

Instance store provides high-performance local storage physically associated with the host. It is ephemeral: data is lost when the instance is stopped, terminated, or otherwise moved to different underlying hardware. Use it for temporary data, caches, scratch space, or workloads designed to replicate data elsewhere—not as the sole copy of durable data.

IP address behavior

Every EC2 instance has at least one private IPv4 address. Private IP addresses are used in both public and private subnets and are normally retained when an instance is stopped and started.

A public IPv4 address is temporary. It is released when the instance is stopped or terminated and a new public address may be assigned when the instance starts again. Public IPv4 addresses are chargeable under current AWS pricing.

An Elastic IP address is a static public IPv4 address allocated to your account. It remains associated with the instance across stop/start operations unless you disassociate or release it. Elastic IP addresses are also chargeable, including cases where they are allocated but not appropriately used.

IPv6 addresses associated with an instance are retained across stop/start operations, subject to the applicable network interface configuration.

EC2 placement groups

Placement groups influence how instances are positioned on AWS hardware. They are selected to optimize latency, throughput, or failure isolation.

#### Cluster placement group

A cluster placement group packs instances closely within a single Availability Zone. This supports low-latency, high-throughput communication between instances and is appropriate for tightly coupled workloads such as high-performance computing.

The tradeoff is reduced flexibility: a cluster placement group is constrained to one Availability Zone and may have capacity limitations when launching larger numbers of instances.

#### Partition placement group

A partition placement group divides instances into logical partitions. Instances in separate partitions are placed on separate underlying hardware, reducing the chance that one hardware failure affects multiple partitions.

This is useful for distributed systems that replicate data across nodes, including Hadoop, Cassandra, and Kafka. The application remains responsible for replication and quorum behavior.

#### Spread placement group

A spread placement group places a small number of instances across distinct underlying hardware. It is designed to reduce correlated hardware failures for critical, independent instances.

Spread placement groups have stricter capacity limits than partition placement groups, so they are better suited to a small number of important instances rather than large distributed fleets.

NAT instance versus NAT gateway

A NAT gateway is the usual choice for allowing instances in private subnets to initiate outbound IPv4 connections to the internet without accepting unsolicited inbound connections.

A NAT gateway is an AWS-managed service. It scales within its Availability Zone, uses an Elastic IP address for internet-facing translation, and does not use security groups. For Availability Zone resilience, deploy a NAT gateway in each AZ used by private workloads and route each private subnet to the local gateway.

A NAT instance is an EC2 instance that you manage. You must configure routing and forwarding, size it appropriately, patch it, monitor it, and design failover. It uses a security group and can use either a public or Elastic IP address. NAT instances may be appropriate for specialized inspection or filtering designs, but they generally create more operational work and a larger failure domain than NAT gateways.

Neither NAT gateway nor NAT instance provides inbound internet access to the private instances behind it.

EC2 instance lifecycle

Action or stateImportant behavior
RebootPerforms an operating-system reboot. The instance ID, private and public address assignments, DNS name, and attached storage remain associated. There is no separate instance replacement.
StopApplies to EBS-backed instances. Compute billing stops, but EBS volumes continue to incur charges. RAM contents are lost. The instance may start on different underlying hardware. The private IP and IPv6 addresses remain; an automatically assigned public IPv4 address is released.
HibernateSaves RAM contents to the EBS root volume, then stops the instance. On start, the root volume and memory state are restored and processes can resume. Hibernation must be enabled at launch and the instance must meet AWS prerequisites.
TerminateDeletes the instance and cannot be reversed. The root EBS volume is deleted by default, while other volumes depend on their DeleteOnTermination settings.
RetirementAWS may retire an instance when its underlying hardware cannot be repaired. The instance can be stopped or terminated according to the retirement process and AWS notification.
RecoverCloudWatch status checks can trigger recovery for supported instance failures caused by underlying hardware or platform problems. Recovery moves the instance to healthy hardware while preserving the instance’s configuration and attached resources where supported.

Stopping is not equivalent to terminating. Stopping preserves the instance definition and usually its EBS volumes; terminating removes the instance.

Nitro System and Nitro Enclaves

The AWS Nitro System uses dedicated hardware and a lightweight Nitro hypervisor to offload virtualization functions such as networking and EBS processing. This architecture supports strong isolation, high throughput, low virtualization overhead, and rapid introduction of new EC2 capabilities.

Nitro-based capabilities can include:

  • Elastic Network Adapter (ENA) for enhanced networking
  • Elastic Fabric Adapter (EFA) for specialized high-performance networking
  • High-performance EBS and local storage paths
  • Bare metal instance options
  • Large network bandwidth and dense local storage options

Nitro Enclaves create isolated compute environments for sensitive processing. An enclave has no persistent storage, interactive access, or external networking. It can use cryptographic attestation to prove that an approved enclave image is running and can integrate with AWS Key Management Service for controlled cryptographic operations.

Typical use cases include processing personally identifiable information, healthcare data, financial data, and valuable intellectual property while reducing exposure of plaintext sensitive data to the parent instance.

EC2 pricing and tenancy options

OptionCommitment or riskTypical use
On-Demand InstancesNo long-term commitment; highest standard flexibility and priceUnpredictable workloads, development, and short-term capacity
Reserved InstancesOne- or three-year commitment for a defined instance configuration or scope; substantial discountSteady, predictable EC2 usage
Spot InstancesDeep discount, but AWS can interrupt capacity with limited noticeFault-tolerant, stateless, batch, or distributed workloads
Savings PlansOne- or three-year commitment to a specified compute spend; flexible coverage depends on plan typeConsistent compute usage across eligible services and instance choices
Dedicated InstancesInstances run on hardware dedicated to a single AWS customer, but you do not control the specific hostPhysical isolation without requiring host-level placement visibility
Dedicated HostsA physical server dedicated to your account, with visibility into sockets, cores, and host placementLicensing, compliance, host affinity, and workloads requiring dedicated hardware control

Reserved Instances and Savings Plans are not interchangeable. Reserved Instances are tied more closely to instance attributes and can provide regional or zonal capacity benefits depending on the purchase type. Savings Plans primarily apply a committed hourly spend to eligible compute usage.

Exam-Relevant Takeaways

  • An AMI is regional. Copy it to another Region before launching from it there.
  • EBS is persistent block storage; instance store is ephemeral local storage.
  • Stopping an EBS-backed instance loses RAM, preserves EBS volumes, and releases an automatically assigned public IPv4 address.
  • Rebooting does not change the instance’s address assignments or instance ID.
  • Termination is irreversible, and the root EBS volume is deleted by default.
  • Use cluster placement groups for tightly coupled, low-latency workloads.
  • Use partition placement groups when distributed nodes need hardware isolation between groups.
  • Use spread placement groups for a small number of critical instances requiring distinct hardware.
  • Deploy NAT gateways per Availability Zone when avoiding a cross-AZ single point of failure is important.
  • Spot Instances are appropriate only when interruption can be tolerated.
  • Dedicated Hosts expose host topology and support host affinity; Dedicated Instances provide isolation without the same host-level visibility.
  • Nitro Enclaves are isolated environments, not general-purpose virtual machines: they lack external networking, persistent storage, and interactive access.

Architecture Decision Guide

RequirementRecommended choiceReasoning
Durable block storage for an EC2 applicationEBSSurvives instance stop and is designed for persistent block storage
Temporary high-speed scratch dataInstance storeVery high local performance, with the tradeoff of data loss on instance lifecycle or host failure
Low-latency communication among tightly coupled nodesCluster placement groupPacks instances within an AZ for network performance
Hardware fault isolation for replicated distributed nodesPartition placement groupSeparates logical partitions across underlying hardware
Hardware isolation for a small set of critical instancesSpread placement groupReduces correlated hardware failure risk
Standard outbound internet access from private IPv4 subnetsNAT gatewayManaged, scalable, and easier to operate than a NAT instance
Workload can be interrupted for a major discountSpot InstancesLow cost with interruption risk
Predictable EC2 usage over one or three yearsReserved Instances or Savings PlansCommitment reduces cost; choose based on required flexibility
Software license depends on sockets or coresDedicated HostProvides visibility into host topology and placement
Sensitive processing requiring attestation and restricted accessNitro EnclaveIsolated environment with no external network or persistent storage

Common Exam Traps

  • Confusing a public IP with an Elastic IP: An automatically assigned public IPv4 address can change after stop/start. An Elastic IP is designed to remain static.
  • Assuming private subnets cannot use NAT: Private instances can initiate outbound IPv4 connections through a NAT gateway or NAT instance; they do not receive unsolicited inbound connections through it.
  • Treating a NAT gateway as an AZ-wide resilient service: A NAT gateway is scoped to one AZ. For resilient multi-AZ architecture, use one per AZ and route locally.
  • Using instance store for durable data: Instance store is lost when the instance stops or is terminated. Replicate or move important data to durable storage.
  • Assuming stopping deletes EBS data: Stopping releases compute capacity but normally leaves EBS volumes attached and billable.
  • Assuming termination is recoverable: A terminated EC2 instance cannot be recovered as an instance. Protect required data with snapshots, backups, or external replication.
  • Choosing a cluster placement group for a multi-AZ design: Cluster placement groups are constrained to one Availability Zone.
  • Confusing partition and spread placement groups: Partition groups support larger distributed fleets; spread groups are intended for a small number of instances.
  • Assuming Dedicated Instances provide host identity: Dedicated Hosts provide host ID, socket/core visibility, and host affinity. Dedicated Instances do not provide the same level of control.
  • Using Spot for non-interruptible stateful workloads: Spot capacity can be reclaimed. The workload must tolerate interruption or have a robust checkpointing and replacement strategy.

Real-World Engineer Notes

  • Design EC2 fleets as replaceable. Use AMIs, launch templates, Auto Scaling, health checks, and externalized state rather than depending on one long-lived instance.
  • Use user data for bootstrap logic, but keep scripts idempotent and avoid embedding secrets. Retrieve secrets from services such as AWS Secrets Manager or Systems Manager Parameter Store.
  • Prefer IMDSv2 and restrict metadata access where possible. Metadata credentials can be powerful if an application is compromised.
  • Spread critical workloads across Availability Zones. A single NAT gateway, single EBS-backed instance, or single placement group does not automatically provide application resilience.
  • For instance-store workloads, replicate data at the application layer and validate behavior during instance replacement.
  • Monitor EC2 status checks separately from application health. A system status check can identify infrastructure issues, while an instance status check may indicate a problem inside the guest operating system.
  • Dedicated Hosts can improve licensing compliance but often cost more and reduce placement flexibility. Confirm the license model and AWS licensing rules before selecting them.

Quick Reference Summary

  • AMI: Regional launch image containing OS, root volume template, permissions, and block device mappings.
  • EBS: Persistent block storage; remains after stop and is billed while provisioned.
  • Instance store: Ephemeral local storage with high performance.
  • User data: Launch-time bootstrap input.
  • Metadata: Information retrieved by the running instance through IMDS.
  • Private IP: Always present and generally retained across stop/start.
  • Public IPv4: Temporary and released on stop.
  • Elastic IP: Static public IPv4 address allocated to the account.
  • Cluster placement: Low latency and high throughput in one AZ.
  • Partition placement: Fault isolation for distributed systems.
  • Spread placement: Distinct hardware for a small number of critical instances.
  • NAT gateway: Managed outbound IPv4 translation; deploy per AZ for resilience.
  • Hibernate: Saves RAM to EBS and resumes the instance state later.
  • Nitro Enclave: Isolated, attested environment without external networking or persistent storage.
  • Dedicated Host: Entire physical server allocated to one customer with host-level visibility.

Flashcards

  1. Q: What does an AMI contain?

A: A launchable operating system and software image, root volume template, launch permissions, and block device mappings.

  1. Q: Why must an AMI be copied before launching it in another Region?

A: AMIs are regional resources and cannot be launched directly from a different Region.

  1. Q: Which EC2 storage type is persistent?

A: EBS. Instance store is ephemeral local storage.

  1. Q: What happens to an automatically assigned public IPv4 address when an instance is stopped?

A: It is released, and a different public address may be assigned when the instance starts again.

  1. Q: What happens to a private IP address during stop/start?

A: It is generally retained.

  1. Q: Which placement group is best for tightly coupled HPC nodes?

A: A cluster placement group.

  1. Q: Which placement group separates distributed nodes into failure-isolated partitions?

A: A partition placement group.

  1. Q: What is the principal resilience limitation of a NAT gateway?

A: It is deployed in one AZ, so resilient architectures generally use one NAT gateway per AZ.

  1. Q: What happens to RAM during hibernation?

A: RAM contents are saved to the EBS root volume and restored when the instance starts.

  1. Q: Can a terminated EC2 instance be recovered?

A: No. Termination is irreversible.

  1. Q: When is a Dedicated Host preferable to a Dedicated Instance?

A: When socket/core visibility, host affinity, or host-based licensing requirements apply.

  1. Q: What restrictions apply to Nitro Enclaves?

A: They have no persistent storage, interactive access, or external networking and are intended for isolated sensitive processing.

Practice Questions

Question 1

A company runs a distributed Cassandra cluster on EC2. It wants to reduce the probability that a single hardware failure affects multiple replica groups. Which placement strategy best meets the requirement?

A. Cluster placement group
B. Partition placement group
C. Spread placement group across multiple Regions
D. Dedicated Instances without a placement group

Correct answer: B. Partition placement group

Explanation: Partition placement groups isolate logical partitions on separate underlying hardware and are intended for distributed and replicated systems such as Cassandra. Cluster placement groups optimize low latency, while spread placement groups are designed for a small number of critical instances.

Question 2

An application runs in private subnets across three Availability Zones and requires resilient outbound internet access for software updates. Which design is most appropriate?

A. One NAT gateway in a public subnet, with all private subnets routing to it
B. One NAT instance in each private subnet
C. One NAT gateway in each AZ, with each private subnet using the local gateway
D. Assign public IPv4 addresses directly to all application instances

Correct answer: C. One NAT gateway in each AZ, with each private subnet using the local gateway

Explanation: A NAT gateway is AZ-scoped. Deploying one per AZ avoids dependence on a cross-AZ NAT path or a single gateway failure. Public addresses on application instances would not preserve the intended private-subnet security model.

Question 3

An EC2 instance uses an automatically assigned public IPv4 address and an EBS root volume. The instance is stopped and later started. Which result is expected?

A. The public IPv4 address is retained and RAM is restored
B. The public IPv4 address is released, the EBS volume remains, and RAM is lost
C. The EBS root volume is deleted and the private IP changes
D. The instance is terminated because it was stopped

Correct answer: B. The public IPv4 address is released, the EBS volume remains, and RAM is lost

Explanation: Stopping an EBS-backed instance preserves its EBS volumes but loses memory contents and releases an automatically assigned public IPv4 address. The private IP is generally retained.

Question 4

A software vendor licenses an application according to the number of physical sockets and cores available on the server. The customer also needs to associate an instance with a specific physical host. Which EC2 option should be selected?

A. Dedicated Instance
B. Spot Instance
C. Dedicated Host
D. Reserved Instance

Correct answer: C. Dedicated Host

Explanation: Dedicated Hosts provide an entire physical server along with visibility into sockets, cores, and host identity. Dedicated Instances provide hardware-level isolation from other customers but not the same host-level visibility and affinity controls.

Question 5

A security-sensitive service must process payment data inside an environment that can prove only an approved code image is running. The environment must not have external network connectivity or persistent storage. Which capability is the best fit?

A. An encrypted EBS volume on a standard EC2 instance
B. An EC2 Dedicated Host
C. A Nitro Enclave with cryptographic attestation
D. An instance store volume in a cluster placement group

Correct answer: C. A Nitro Enclave with cryptographic attestation

Explanation: Nitro Enclaves provide isolated compute environments without external networking, interactive access, or persistent storage. Cryptographic attestation can be used to verify the enclave code, and integration with AWS KMS supports controlled handling of sensitive cryptographic operations.