AWS Certified Solutions Architect – Associate (SAA-C03) — Question 896
A company has stored millions of objects across multiple prefixes in an Amazon S3 bucket by using the Amazon S3 Glacier Deep Archive storage class. The company needs to delete all data older than 3 years except for a subset of data that must be retained. The company has identified the data that must be retained and wants to implement a serverless solution.
Which solution will meet these requirements?
Answer options
- A. Use S3 Inventory to list all objects. Use the AWS CLI to create a script that runs on an Amazon EC2 instance that deletes objects from the inventory list.
- B. Use AWS Batch to delete objects older than 3 years except for the data that must be retained.
- C. Provision an AWS Glue crawler to query objects older than 3 years. Save the manifest file of old objects. Create a script to delete objects in the manifest.
- D. Enable S3 Inventory. Create an AWS Lambda function to filter and delete objects. Invoke the Lambda function with S3 Batch Operations to delete objects by using the inventory reports.
Correct answer: D
Explanation
S3 Batch Operations combined with S3 Inventory and AWS Lambda provides a fully serverless, highly scalable method to perform custom actions on millions of S3 objects. Option A is incorrect because using an Amazon EC2 instance is not a serverless solution. Options B and C are incorrect because AWS Batch and AWS Glue are not designed to natively orchestrate S3 object deletions at this scale as efficiently as S3 Batch Operations.