Q90 — AWS SAA-C03 Ch.13
Question 90 of 100 | ← Chapter 13
Q990. 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?
- 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. 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.
Explanation
To implement a serverless solution for deleting all data older than 3 years from an Amazon S3 bucket, while retaining a specific subset of data, the best option is: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.Explanation:S3 Inventory: This feature allows you to generate reports about the objects stored in your S3 bucket, including their storage class and last modified date. You can use these reports to identify which objects are older than 3 years.AWS Lambda: You can create a Lambda function that processes the inventory report to filter out objects older than 3 years while excluding the subset of data that needs to be retained. This approach is serverless and scales automatically.S3 Batch Operations: This service allows you to perform large-scale operations on S3 objects. By invoking your Lambda function with S3 Batch Operations, you can efficiently delete the identified objects in bulk.Evaluation of Other Options:A. Use S3 Inventory to list all objects...: This option requires an EC2 instance to run a script, which is not a serverless solution and introduces additional management overhead.B. Use AWS Batch to delete objects older than 3 years...: AWS Batch is not ideal for this task, as it is typically used for batch processing jobs rather than directly deleting S3 objects.C. Provision an AWS Glue crawler to query objects older than 3 years...: This approach would be unnecessarily complex for simply filtering and deleting S3 objects. AWS Glue is more suited for data processing and transformation tasks rather than directly managing S3 objects.In summary, Option D provides an efficient and serverless solution to meet the requirements of deleting S3 objects older than 3 years while retaining specific data.