
Answer-first summary for fast verification
Answer: Use S3 Lifecycle to delete expired object versions and retain the two most recent versions.
## Explanation **Correct Answer: A** - Use S3 Lifecycle to delete expired object versions and retain the two most recent versions. ### Why Option A is Correct: 1. **Least Operational Overhead**: S3 Lifecycle policies are a native AWS feature that automatically manages object lifecycle without requiring any custom code or manual intervention. 2. **Cost-Effective**: Lifecycle policies can automatically delete older versions, reducing storage costs for non-current object versions. 3. **Version Retention**: S3 Lifecycle supports versioning and can be configured to retain only a specified number of recent versions. 4. **No Application Changes**: The solution maintains versioning, which aligns with the company's requirement to minimize application changes. ### Why Other Options are Incorrect: **Option B (Lambda Function)**: - Requires custom code development and maintenance - Needs to be triggered regularly (via CloudWatch Events) - Has operational overhead for monitoring, error handling, and updates - Incurs additional costs for Lambda execution **Option C (S3 Batch Operations)**: - Requires manual initiation or scheduling - Involves operational overhead for job management - Not a continuous, automated solution like Lifecycle policies - Better suited for one-time bulk operations rather than ongoing management **Option D (Deactivate Versioning)**: - Would require application changes (contradicts the requirement to minimize changes) - Once versioning is disabled, you cannot selectively retain only two versions - All previous versions would become inaccessible - Not a cost optimization strategy for versioned objects ### Key AWS Concepts: - **S3 Lifecycle Policies**: Automate transitioning objects to different storage classes or deleting them based on rules - **S3 Versioning**: When enabled, S3 preserves multiple versions of an object - **Noncurrent Version Expiration**: Lifecycle rule that automatically deletes noncurrent object versions after a specified number of days - **Version Retention**: Can be configured to keep only the most recent N versions ### Best Practice: For ongoing cost optimization of versioned S3 objects with minimal operational overhead, S3 Lifecycle policies are the recommended AWS-native solution.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company uses Amazon S3 to store high-resolution pictures in an S3 bucket. To minimize application changes, the company stores the pictures as the latest version of an S3 object. The company needs to retain only the two most recent versions of the pictures.
The company wants to reduce costs. The company has identified the S3 bucket as a large expense.
Which solution will reduce the S3 costs with the LEAST operational overhead?
A
Use S3 Lifecycle to delete expired object versions and retain the two most recent versions.
B
Use an AWS Lambda function to check for older versions and delete all but the two most recent versions.
C
Use S3 Batch Operations to delete noncurrent object versions and retain only the two most recent versions.
D
Deactivate versioning on the S3 bucket and retain the two most recent versions.