๐Ÿง  EC2 Instance Storage โ€“ Notes & Concepts

๐Ÿงฑ EBS Overview

EBS stands for Elastic Block Storage.
It provides persistent block-level storage volumes for EC2 instances.

  • EBS volumes persist even after instance termination, depending on configuration
  • They are bound to a single Availability Zone (AZ) and cannot be attached across AZs
  • EBS volumes are network-attached drives, not physically connected
  • Volumes can be detached and reattached to other instances within the same AZ
  • To move across AZs, take a snapshot, then create a new volume in another AZ

EBS volumes can be provisioned for:

  • Size (in GB)
  • Performance (IOPS)

Both can be modified over time.

โœ… Note for the Practitioner exam: EBS is single-attach by default (one volume โ†” one instance), even though multi-attach exists.

๐Ÿ“Œ Delete on Termination

  • By default, the root volume has โ€œDelete on Terminationโ€ enabled
  • Other volumes do not, and will persist unless explicitly deleted
  • This behavior is configurable at instance launch

๐Ÿ”’ Changing the root volumeโ€™s termination behavior cannot be done via the Console once launched โ€” use CLI or PowerShell.

๐Ÿ—‚๏ธ EBS Snapshots

  • Snapshots are backups of EBS volumes
  • They can be created while the volume is in use, though consistency is not guaranteed
  • Snapshots are stored in S3 (but not directly accessible via the S3 console)

๐Ÿ” Snapshot Archiving

  • Snapshots can be archived to EBS Snapshot Archive
    ๐Ÿท๏ธ 75% cheaper, but takes 24โ€“72h to restore

  • Snapshots can also be sent to a Recycle Bin with retention from 1 to 365 days

  • Volumes can be recreated from snapshots in any AZ

๐Ÿ“ฆ Amazon Machine Image (AMI)

AMI = Amazon Machine Image, a template for launching EC2 instances.
Similar in concept to VMware templates.

  • An AMI is region-specific but can be copied across regions
  • An AMI includes: OS + configuration + installed packages + metadata

๐Ÿ› ๏ธ Creating a Custom AMI

  1. Launch and configure an EC2 instance
  2. Stop the instance (for consistency)
  3. Create the AMI (snapshot-based)
  4. Launch new instances from that AMI

๐Ÿงช EC2 Image Builder

EC2 Image Builder automates the creation, testing, and distribution of AMIs.

๐Ÿ”„ Flow

  1. EC2 Image Builder creates a temporary Builder Instance
  2. Customizations (updates, packages) are applied
  3. AMI is created
  4. Optional tests are run automatically (security, health, etc.)
  5. AMI is distributed to chosen regions
  • Can run manually, on schedule, or triggered by events
  • Image Builder is free โ€” you pay only for underlying EC2, storage, and data transfer

โšก EC2 Instance Store

An EC2 Instance Store is a type of ephemeral storage that offers:

  • Very fast physical disks attached to the host machine
  • Better performance than EBS, but non-persistent

โ— If the instance is stopped or terminated, all data is lost

๐Ÿงฐ Best Use Cases

  • Scratch data
  • Temporary cache
  • Buffering
  • Data that can be rebuilt or is disposable

๐Ÿ›‘ Not suitable for databases or data that must survive stop/terminate

๐Ÿ“ EFS Overview

EFS = Elastic File System
A fully-managed, scalable, NFS-based shared file system.

  • Can be mounted by hundreds of EC2 instances simultaneously
  • Works across AZs
  • Linux-only (not compatible with Windows)
  • Pay-per-use, no capacity planning required

๐ŸงŠ EFS-IA (Infrequent Access)

  • For rarely accessed files
  • Costs up to 92% less
  • EFS can auto-move files to EFS-IA based on Lifecycle Policies

๐Ÿ›ก๏ธ Shared Responsibility Model (Storage)

AWS Responsibility Customer Responsibility
Underlying infrastructure Managing backups/snapshots
Hardware replacement, AZ replication (EBS/EFS) Data encryption
Isolation from AWS personnel Managing access controls
Availability guarantees Choosing persistence model (EBS vs. Instance Store)

โ— For Instance Store, customers are fully responsible for data survival

๐Ÿ“ก Amazon FSx Overview

Amazon FSx provides managed third-party file systems.

  • FSx for Lustre โ€“ HPC, parallel workloads
  • FSx for Windows File Server โ€“ Full SMB support, Windows-native
  • FSx for NetApp ONTAP โ€“ Advanced storage with NetApp features

โœ… Quick Summary (Cheat Sheet Style)

Storage Type Persistent Attachable to Multiple EC2s Use Case
EBS Yes No (by default) General-purpose block storage
Instance Store No No High-speed, temporary scratch space
EFS Yes Yes (Linux only) Shared file systems, scaling workloads
FSx Yes Yes (depends on config) Windows/NetApp/Lustre high-performance FS