4.EC2 Instance Storage
Index
- EBS –
- type of device network/physical(access speed),
- number of instances it can be applied to(multi-tenancy?)
An EBS (Elastic Block Store) Volume is a network drive(i.e. not a physical drive) you can attach to your instances while they run.
- It allows your instances to persist data, even after their termination
- They can only be mounted to one instance at a time (at the CCP level)
Advantage and disadvantage
• It uses the network to communicate the instance, which means there might be a bit of latency
• It can be detached from an EC2 instance and attached to another one quickly
It’s locked to an Availability Zone (AZ)
• An EBS Volume in us-east-1a cannot be attached to us-east-1b
• To move a volume across, you first need to snapshot it
EBS – Delete on Termination attribute
By default, the root EBS volume is deleted (attribute enabled)
Use case: preserve root volume when instance is terminated
EBS Snapshots
Make a backup (snapshot) of your EBS volume at a point in time
• Not necessary to detach volume to do snapshot, but recommended
• Can copy snapshots across AZ or Region
AMI Overview
AMI = Amazon Machine Image,
AMI are a customization of an EC2 instance.
• You add your own software, configuration, operating system, monitoring…
• Faster boot / configuration time because all your software is pre-packaged
You can launch EC2 instances from:
• A Public AMI: AWS provided
• Your own AMI: you make and maintain them yourself
• An AWS Marketplace AMI: an AMI someone else made (and potentially sells)
AMI Process (from an EC2 instance)
• Start an EC2 instance and customize it
• Stop the instance (for data integrity)
• Build an AMI – this will also create EBS snapshots
• Launch instances from other AMIs
EC2 Image Builder
Used to automate the creation of Virtual Machines or container images
Automate the creation, maintain, validate and test EC2 AMIs
• Can be run on a schedule (weekly, whenever packages are updated, etc…)
• Free service (only pay for the underlying resources)
EC2 Instance Store
EBS volumes are network drives with good but “limited” performance
• If you need a high-performance hardware disk, use EC2 Instance Store
EC2 Instance Store lose their storage if they’re stopped (ephemeral)
• Good for buffer / cache / scratch data / temporary content
• Risk of data loss if hardware fails
• Backups and Replication are your responsibility
EFS – Elastic File System
Managed NFS (network file system) that can be mounted on 100s of EC2
EFS works with Linux EC2 instances in multi-AZ
Highly available, scalable, expensive (3x gp2), pay per use, no capacity planning

EBS vs EFS
- EFS can be mounted to multiple ECS instances (across multiple zones)as compared to EBS with attaches to single EC2 instance at a time
EFS Infrequent Access (EFS-IA)
Storage class that is cost-optimized for files not accessed every day, Up to 92% lower cost compared to EFS Standard
EFS will automatically move your files to EFS-IA based on the last time they were accessed
Enable EFS-IA with a Lifecycle Policy
Amazon FSx for Windows File Server
A fully managed, highly reliable, and scalable Windows native shared file system
Integrated with Microsoft Active Directory
• Can be accessed from AWS or your on-premise infrastructure
Amazon FSx for Lustre
A fully managed, high-performance, scalable file storage for High Performance Computing (HPC)
The name Lustre is derived from “Linux” and “cluster”