Question #1246
A company needs to archive its application logs in an S3 bucket for 5 years. The company uses AWS Organizations to manage multiple accounts, with the parent account centralizing logs into an S3 bucket. The bucket has S3 Versioning enabled. An S3 Lifecycle policy transitions current objects to S3 Glacier Flexible Retrieval after 1 year and deletes them after 5 years. After six years, the bucket's storage metrics indicate continued growth, even though the rate of new log deliveries has remained constant. What is the MOST cost-effective solution to delete objects older than 5 years?
Configure the S3 Lifecycle policy to expire previous versions of objects after 5 years.
Modify the lifecycle policy to transition previous versions to S3 Glacier Deep Archive after 1 year.
Develop a script using AWS Lambda to identify and delete objects older than 5 years.
Enable S3 Intelligent-Tiering to automatically manage object lifetimes.
Explanation
The issue arises because S3 Versioning retains all object versions unless explicitly deleted. The existing lifecycle policy deletes only the current versions after 5 years, leaving previous versions intact. Over time, these previous versions accumulate, causing unexpected storage growth.
- Option A corrects this by expiring previous versions after 5 years, ensuring all versions are deleted, which aligns with the retention policy.
- Option B transitions previous versions to a cheaper storage class but does not delete them, failing to resolve the growth issue.
- Option C introduces unnecessary complexity and cost compared to lifecycle policies.
- Option D focuses on storage tier optimization, not deletion, and does not address the root cause.
Key Points: When using S3 Versioning, lifecycle policies must explicitly manage both current and previous versions. Expiration rules should apply to all versions to enforce retention requirements cost-effectively.
Answer
The correct answer is: A