A company has an application built with AWS Lambda, Amazon S3, Amazon Simple Notification Service (Amazon SNS), and Amazon DynamoDB. An external application uploads objects to the company’s S3 bucket and tags each object with the date and time. A Lambda function periodically reads objects from the S3 bucket based on these tags and writes selected values to a DynamoDB table. The data contains PII. The company must automatically remove data older than 30 days from both the S3 bucket and the DynamoDB table. Which solution provides the highest operational efficiency?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an S3 Lifecycle rule to expire objects older than 30 days. Update the Lambda function to add a TTL attribute to DynamoDB items, and enable TTL on the table to expire items older than 30 days..
Why this is the answer
The correct solution leverages native AWS features for automated data lifecycle management, offering the highest operational efficiency. An S3 Lifecycle rule can automatically expire objects older than 30 days based on their creation date, eliminating the need for custom code. For DynamoDB, enabling Time to Live (TTL) on the table and having the Lambda function add a TTL attribute to new items allows DynamoDB to automatically delete items after the specified period (30 days in this case). This approach minimizes custom code and relies on highly efficient, managed services. The other options are less efficient. Modifying the Lambda function to add an S3 TTL flag is unnecessary when S3 Lifecycle rules can use the object's creation date. Manually deleting DynamoDB items via a Lambda function is less efficient than using DynamoDB's native TTL feature, which is optimized for this purpose. Using object tags for S3 expiration is possible but less direct than using the object's age when the requirement is simply "older than 30 days.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed