0
0
AWScloud~10 mins

Time to live (TTL) for expiration in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable TTL on a DynamoDB table.

AWS
aws dynamodb update-time-to-live --table-name MyTable --time-to-live-specification Enabled=[1],AttributeName=ttl
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cenabled
Dyes
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enabled' or 'yes' instead of true
Setting Enabled to false disables TTL
2fill in blank
medium

Complete the code to specify the TTL attribute name in DynamoDB.

AWS
aws dynamodb update-time-to-live --table-name MyTable --time-to-live-specification Enabled=true,AttributeName=[1]
Drag options to blanks, or click blank then click option'
Aexpiration
BtimeToLive
Cttl
Dexpiry
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names not defined in the table
Using incorrect casing or spelling
3fill in blank
hard

Fix the error in the TTL configuration command.

AWS
aws dynamodb update-time-to-live --table-name MyTable --time-to-live-specification Enabled=[1],AttributeName=ttl
Drag options to blanks, or click blank then click option'
Atrue
BTrue
C'true'
DTRUE
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase or quoted true
Using string values instead of boolean
4fill in blank
hard

Fill both blanks to create a TTL attribute in a DynamoDB item.

AWS
item = {'id': '123', 'name': 'test', '[1]': [2]
Drag options to blanks, or click blank then click option'
Attl
Bexpiration
C1672531199
D2023-12-31T23:59:59Z
Attempts:
3 left
💡 Hint
Common Mistakes
Using date strings instead of epoch timestamps
Using wrong attribute names
5fill in blank
hard

Fill all three blanks to configure TTL in a CloudFormation template.

AWS
"Resources": {
  "MyTable": {
    "Type": "AWS::DynamoDB::Table",
    "Properties": {
      "TableName": "MyTable",
      "AttributeDefinitions": [
        {"AttributeName": "id", "AttributeType": "S"},
        {"AttributeName": "[1]", "AttributeType": "N"}
      ],
      "KeySchema": [
        {"AttributeName": "id", "KeyType": "HASH"}
      ],
      "TimeToLiveSpecification": {
        "Enabled": [2],
        "AttributeName": "[3]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Attl
Btrue
Dexpiration
Attempts:
3 left
💡 Hint
Common Mistakes
Using different attribute names in definitions and TTL spec
Setting Enabled to false or a string