Section 4 - EC2 Instance Storage
EC2 Storage Options Study Notes
- EBS volumes (Elastic Block Store)
- What they are and purpose
- EBS stands for Elastic Block Store. They are network drives that can be attached to EC2 instances while they run, enabling data to persist after the instance stops or terminates.
- You can recreate an instance and mount the same EBS volume to recover data, which is essential for persistence and recovery scenarios.
- EBS volumes are bound to a specific Availability Zone (AZ) and can only be attached to one instance at a time at the CCP (Certified Cloud Practitioner) level.
- EBS volumes are network-attached and communicate with the instance over the network, so there can be some latency compared to physical drives.
- Types and provisioning
- GP2 (General Purpose SSD) and GP3 volumes are commonly used in this course.
- AWS provides a baseline free quota of 30 GB of EBS storage of type GP (General Purpose) per month in general practice for learners.
- When you create an EBS volume, you must provision capacity in advance (size in GB and IOPS). You are billed for the provisioned capacity, and you can increase capacity over time for better performance or more space.
- Available options include GP2 and GP3 (SSD-based) and other types not emphasized here.
- AZ binding and movement across AZs
- An EBS volume is bound to an AZ; e.g., a volume created in US-EAST-1A cannot be attached to a running instance in US-EAST-1B.
- If you need to move data across AZs, you can create a snapshot of the volume and restore the snapshot into a new volume in the target AZ.
- You can create multiple EBS volumes attached to a single EC2 instance (think of them as multiple network USB sticks into one machine).
- Attachments and use cases
- An EC2 instance can have one or more EBS volumes attached; an EBS volume cannot be attached to more than one instance at the same time (except specific cases not in scope here).
- You can detach and reattach volumes quickly for failover or maintenance scenarios.
- Root volume and delete on termination
- When launching an EC2 instance, the root volume has a delete-on-termination attribute.