Which solution meets these requirements?
Use an AWS CloudFormation template to deploy the complete solution. Redeploy the CloudFormation stack every 30 days, and delete the original stack.
Use an EC2 instance that runs a monitoring application from AWS Marketplace. Configure the monitoring application to use Amazon DynamoDB Streams to store the timestamp when a new item is created in the table. Use a script that runs on the EC2 instance to delete items that have a timestamp that is older than 30 days.
Configure Amazon DynamoDB Streams to invoke an AWS Lambda function when a new item is created in the table. Configure the Lambda function to delete items in the table that are older than 30 days.
Extend the application to add an attribute that has a value of the current timestamp plus 30 days to each new item that is created in the table. Configure DynamoDB to use the attribute as the TTL attribute.
Explanations:
This option requires redeploying the entire CloudFormation stack every 30 days, which is inefficient and involves unnecessary overhead. It does not provide a scalable or cost-effective solution for data expiration management.
Running a monitoring application on an EC2 instance introduces additional cost and maintenance overhead. Additionally, this solution involves using a script to manually delete old items, which can lead to performance issues and does not utilize DynamoDB’s built-in capabilities for data expiration.
While this option uses DynamoDB Streams and Lambda, it involves additional complexity and may not be efficient since it deletes items as they are created. It does not efficiently manage the aging data or automate the deletion based on a timestamp without an explicit TTL configuration.
This option leverages DynamoDB’s Time to Live (TTL) feature, which is designed for automatically deleting items after a specified timestamp. By adding a TTL attribute to each new item, the company can efficiently manage the data lifecycle without incurring additional operational overhead or costs. This is the simplest and most cost-effective solution.