Q34 — AWS DVA-C02 Ch.2

Question 34 of 100 | ← Chapter 2

A developer is building a new application that uses an Amazon DynamoDB table. The specification requires deletion of all items older than 48 hours. Which solution meets this requirement?

Correct Answer: C. Create a new attribute with numeric data type. Enable TTL on the DynamoDB table for this attribute. In application code, set this attribute’s value to the current timestamp plus 48 hours for each newly inserted item.

Explanation

In Amazon DynamoDB, TTL must be enabled at the table level—not on a Local Secondary Index—and requires a numeric attribute representing epoch time in seconds. To expire items after 48 hours, the application must set the TTL attribute to the current Unix timestamp plus 48 hours (in seconds). Options A and B incorrectly attempt to enable TTL on an LSI, which is unsupported. Option D uses a string data type, which is invalid for TTL. Only Option C correctly configures TTL at the table level with a numeric attribute and proper timestamp calculation.