Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable TTL for DynamoDB using cloud formation

I'm trying to setup a TTL on an existing dynmoDB table

Getting an error

An error occurred: Incoming - Value of property TimeToLiveSpecification must be an object.

this is my template

    Incoming:
  Type: AWS::DynamoDB::Table
  Properties:
    TableName: table-test
    KeySchema:
      - AttributeName: number
        KeyType: HASH
      - AttributeName: number2
        KeyType: RANGE
    AttributeDefinitions:
      - AttributeName: number
        AttributeType: S
      - AttributeName: number2
        AttributeType: S
    TimeToLiveSpecification: 
      - AttributeName: TimeToLive
        Enabled: true
    ProvisionedThroughput:
      ReadCapacityUnits: 2
      WriteCapacityUnits: 2

I'm probalbly missing somethins simple , but can't figure it out

like image 889
Shachaf.Gortler Avatar asked Dec 23 '22 11:12

Shachaf.Gortler


1 Answers

figured it out , a misplaced - near the AttributeName under the TimeToLiveSpecification section

Incoming:
  Type: AWS::DynamoDB::Table
  Properties:
    TableName: table-test
    KeySchema:
      - AttributeName: number
        KeyType: HASH
      - AttributeName: number2
        KeyType: RANGE
    AttributeDefinitions:
      - AttributeName: number
        AttributeType: S
      - AttributeName: number2
        AttributeType: S
    TimeToLiveSpecification: 
        AttributeName: TimeToLive   # <-- stray dash was here
        Enabled: true
    ProvisionedThroughput:
      ReadCapacityUnits: 2
      WriteCapacityUnits: 2
like image 57
Shachaf.Gortler Avatar answered Jan 06 '23 17:01

Shachaf.Gortler