teluzia.Cloud Engineer · Day 39
CHAPTER 06 · AWS FOUNDATIONS

EC2 and EBS

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Connect virtual compute with persistent block storage. EC2 instances run an operating system and applications; EBS volumes provide block devices in an Availability Zone. Your offline lifecycle table will show which data survives a stop, termination or volume deletion, and optional CLI calls inspect existing resources only. An EC2 launch combines an AMI, instance type, subnet, security groups, storage and identity role. The AMI supplies an operating-system image; the instance type supplies compute capacity. Public reachability depends on networking and addressing, not merely choosing a machine size. An instance role supplies workload permissions independently from login mechanisms. EBS volumes are block storage associated with an AZ and attached to compatible instances in that zone. For EBS-backed instances, stopping normally preserves attached EBS data, but volumes continue to incur applicable charges. Termination behavior depends on each volume’s DeleteOnTermination setting. Instance-store data has different lifecycle behavior.

Think of it this way

An EC2 instance is a rented workstation; EBS is an attached disk; a snapshot is a stored recovery image of that disk.

TOPIC 01 / 03Step by step

EC2 instance configuration

An EC2 launch combines an AMI, instance type, subnet, security groups, storage and identity role. The AMI supplies an operating-system image; the instance type supplies compute capacity. Public reachability depends on networking and addressing, not merely choosing a machine size. An instance role supplies workload permissions independently from login mechanisms. A small app host can use a private subnet and Session Manager access, avoiding a public address and inbound SSH if its managed-node identity, agent and required network paths are correctly configured for the intended access method. Treating launch settings as a connected contract prevents a working compute resource from being mistaken for a securely accessible application, and keeps administration, application traffic and workload API permissions explicit rather than merged into one unrestricted instance setup for convenience. Choosing a public subnet does not automatically make the instance reachable; inspect public addressing, routes, filtering and the listening application rather than changing the AMI or increasing the instance size to solve an unrelated network path problem.

WORKED EXAMPLE
A small app host can use a private subnet and Session Manager access, avoiding a public address and inbound SSH if its managed-node identity, agent and required network paths are correctly configured for the intended access method.
Why this matters

Treating launch settings as a connected contract prevents a working compute resource from being mistaken for a securely accessible application, and keeps administration, application traffic and workload API permissions explicit rather than merged into one unrestricted instance setup for convenience.

A common trap

Choosing a public subnet does not automatically make the instance reachable; inspect public addressing, routes, filtering and the listening application rather than changing the AMI or increasing the instance size to solve an unrelated network path problem.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

EC2 instance configuration

An EC2 launch combines an AMI, instance type, subnet, security groups, storage and identity role. The AMI supplies an operating-system image; the instance type supplies compute capacity. Public reachability depends on networking and addressing, not merely choosing a machine size. An instance role supplies workload permissions independently from login mechanisms. A small app host can use a private subnet and Session Manager access, avoiding a public address and inbound SSH if its managed-node identity, agent and required network paths are correctly configured for the intended access method. Treating launch settings as a connected contract prevents a working compute resource from being mistaken for a securely accessible application, and keeps administration, application traffic and workload API permissions explicit rather than merged into one unrestricted instance setup for convenience. Choosing a public subnet does not automatically make the instance reachable; inspect public addressing, routes, filtering and the listening application rather than changing the AMI or increasing the instance size to solve an unrelated network path problem.

WORKED EXAMPLE
A small app host can use a private subnet and Session Manager access, avoiding a public address and inbound SSH if its managed-node identity, agent and required network paths are correctly configured for the intended access method.

Why this matters

Treating launch settings as a connected contract prevents a working compute resource from being mistaken for a securely accessible application, and keeps administration, application traffic and workload API permissions explicit rather than merged into one unrestricted instance setup for convenience.

A common trap

Choosing a public subnet does not automatically make the instance reachable; inspect public addressing, routes, filtering and the listening application rather than changing the AMI or increasing the instance size to solve an unrelated network path problem.

EBS scope and persistence

EBS volumes are block storage associated with an AZ and attached to compatible instances in that zone. For EBS-backed instances, stopping normally preserves attached EBS data, but volumes continue to incur applicable charges. Termination behavior depends on each volume’s DeleteOnTermination setting. Instance-store data has different lifecycle behavior. A retained data volume can survive instance termination when DeleteOnTermination is false, but it must be tracked and eventually removed if no longer needed; an attached volume cannot simply move between AZs without creating a copy or recovery workflow. Lifecycle knowledge prevents accidental data loss and surprise storage charges, and distinguishes persistent disks from the compute process so teardown checks include remaining volumes rather than assuming terminating an instance removes every billed artifact it ever used during the experiment. Assuming stop means free or terminate always deletes all data ignores volume billing and per-volume deletion flags; inspect actual mappings and retained resources before relying on either action as a complete cleanup procedure for a cloud lab.

WORKED EXAMPLE
A retained data volume can survive instance termination when DeleteOnTermination is false, but it must be tracked and eventually removed if no longer needed; an attached volume cannot simply move between AZs without creating a copy or recovery workflow.

Why this matters

Lifecycle knowledge prevents accidental data loss and surprise storage charges, and distinguishes persistent disks from the compute process so teardown checks include remaining volumes rather than assuming terminating an instance removes every billed artifact it ever used during the experiment.

A common trap

Assuming stop means free or terminate always deletes all data ignores volume billing and per-volume deletion flags; inspect actual mappings and retained resources before relying on either action as a complete cleanup procedure for a cloud lab.

Snapshots, encryption and recovery

EBS snapshots support recovery and cloning of volumes. They are not a substitute for testing application-consistent backups or recording encryption-key access. Encrypt volumes and restrict snapshot sharing as appropriate. A restore creates a new volume and needs correct zone placement, attachment and filesystem or application recovery checks before it becomes useful. A snapshot of a data volume can create a new encrypted volume in a selected AZ; the restored database files may still need application-level recovery if the snapshot captured writes without coordinating a consistent application state at the original host. Testing restore outcomes proves that data is recoverable with the actual permissions and application procedure, rather than merely proving a snapshot object exists and has a timestamp in the console inventory of the account that created it previously during normal operation. Deleting an encryption key or losing its permissions can make retained encrypted backups unusable; include key custody and application consistency in recovery planning instead of assuming storage durability alone guarantees a successful restoration of working application data when needed.

WORKED EXAMPLE
A snapshot of a data volume can create a new encrypted volume in a selected AZ; the restored database files may still need application-level recovery if the snapshot captured writes without coordinating a consistent application state at the original host.

Why this matters

Testing restore outcomes proves that data is recoverable with the actual permissions and application procedure, rather than merely proving a snapshot object exists and has a timestamp in the console inventory of the account that created it previously during normal operation.

A common trap

Deleting an encryption key or losing its permissions can make retained encrypted backups unusable; include key custody and application consistency in recovery planning instead of assuming storage durability alone guarantees a successful restoration of working application data when needed.

KEEP THESE WITH YOU

Today’s takeaways

Separate compute from storage lifecycle.

Match AZ placement.

Test restore and retain key access.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed