Explain S3 storage classes and lifecycle policies.
S3 storage classes trade retrieval cost and latency against storage cost.
- S3 Standard is for frequent access with low latency.
- S3 Intelligent-Tiering automatically moves objects between tiers based on access.
- S3 Standard-IA and One Zone-IA are for infrequent access: cheaper storage with a retrieval fee.
- S3 Glacier Instant Retrieval, Flexible Retrieval, and Deep Archive are archival, with retrieval times from milliseconds to hours.
Lifecycle policies transition or expire objects automatically.
{
"Rules": [{
"ID": "archive-logs",
"Status": "Enabled",
"Filter": {"Prefix": "logs/"},
"Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"},
{"Days": 90, "StorageClass": "GLACIER"}],
"Expiration": {"Days": 365}
}]
}
Match the class to the access pattern. Minimum storage durations of 30 to 180 days can make early transitions costly.