Which solution will meet these requirements?
Enable TTL on the expirationDate attribute in the table. Create a DynamoDB stream. Create an AWS Lambda function to process the deleted items. Create a DynamoDB trigger for the Lambda function.
Create two AWS Lambda functions: one to delete the items and one to process the items. Create a DynamoDB stream. Use the DeleteItem API operation to delete the items based on the expirationDate attribute. Use the GetRecords API operation to get the items from the DynamoDB stream and process them.
Create two AWS Lambda functions: one to delete the items and one to process the items. Create an Amazon EventBridge scheduled rule to invoke the Lambda functions. Use the DeleteItem API operation to delete the items based on the expirationDate attribute. Use the GetRecords API operation to get the items from the DynamoDB table and process them.
Enable TTL on the expirationDate attribute in the table. Specify an Amazon Simple Queue Service (Amazon SQS) dead-letter queue as the target to delete the items. Create an AWS Lambda function to process the items.
Explanations:
Enabling TTL (Time to Live) on the expirationDate attribute automatically deletes items after the specified timestamp without requiring additional code for deletion. Creating a DynamoDB stream and an AWS Lambda function allows processing of deleted items, meeting the requirement with minimal coding.
This option requires writing two separate Lambda functions and managing the deletion and processing logic manually. It involves using both the DeleteItem API and GetRecords API, which increases code complexity compared to simply using TTL.
Similar to option B, this solution also requires two Lambda functions and manual deletion logic. Although it uses an EventBridge rule to schedule the deletions, it still increases code complexity and does not leverage the automated TTL feature, making it less efficient.
While TTL is correctly mentioned, specifying an Amazon SQS dead-letter queue does not apply to the TTL feature, which operates automatically on expiration. This option introduces unnecessary complexity and does not effectively address the requirement to manage deletions based on the expirationDate attribute with minimal coding.