1. Choosing the storage type #
Objects, blocks, files.
Overview #
| Service | Access | Durability and scope | Typical case |
|---|---|---|---|
| S3 | API (HTTP) | 11 nines of durability, regional | Images, exports, backups, data lake, static site |
| EBS | An instance's disk | Replicated within an AZ, snapshots to S3 | System, database on EC2 |
| EFS | NFS, several instances | Regional (multi-AZ) | Shared content, user directories |
2. Amazon S3 #
Object storage.
Classes and lifecycle #
{
"Rules": [{
"ID": "archiver-exports", "Status": "Enabled", "Filter": { "Prefix": "exports/" },
"Transitions": [{ "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 180, "StorageClass": "DEEP_ARCHIVE" }],
"Expiration": { "Days": 2555 }
}]
}Securing a bucket #
- Block public access enabled (default on new buckets); publish through CloudFront if needed.
- Default encryption (SSE-S3 or SSE-KMS), deny non-TLS requests in the bucket policy.
- Versioning to undo a deletion or overwrite, and Object Lock for immutability (anti-ransomware).
aws s3 mb s3://rapports-prod-123456 --region eu-west-3
aws s3api put-bucket-versioning --bucket rapports-prod-123456 --versioning-configuration Status=Enabled
aws s3 cp rapport.pdf s3://rapports-prod-123456/2026/ --sse aws:kms
aws s3 sync ./site s3://site-statique-123456 --delete
aws s3 presign s3://rapports-prod-123456/2026/rapport.pdf --expires-in 900 # lien temporaire3. EBS, EFS and backup #
Disks, shares and protection.
EBS volumes #
| Type | Usage |
|---|---|
| gp3 | General purpose: IOPS and throughput adjustable independently of size |
| io2 | Demanding databases, high and guaranteed IOPS |
| st1 / sc1 | Large sequential volumes at low cost |
aws ec2 create-snapshot --volume-id vol-0abc --description "avant mise à jour"
aws ec2 modify-volume --volume-id vol-0abc --size 200 --volume-type gp3AWS Backup #
AWS Backup centralizes backups (EBS, RDS, DynamoDB, EFS, S3) in plans with retention, cross-region or cross-account copies and locked vaults.
Common mistake: A backup only exists if its restore has been tested: schedule restore tests.
