【问题标题】:Enable TTL for DynamoDB using cloud formation使用云形成为 DynamoDB 启用 TTL
【发布时间】:2018-06-26 21:55:56
【问题描述】:

我正在尝试在现有 dynmoDB 表上设置 TTL

遇到错误

发生错误:传入 - 属性 TimeToLiveSpecification 的值必须是对象。

这是我的模板

    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

我可能错过了一些简单的东西,但无法弄清楚

【问题讨论】:

    标签: amazon-web-services amazon-dynamodb amazon-cloudformation


    【解决方案1】:

    想通了,在AttributeName 部分下的AttributeName 附近放错了-

    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
    

    【讨论】:

      猜你喜欢
      • 2017-08-10
      • 2021-01-31
      • 1970-01-01
      • 1970-01-01
      • 2018-06-21
      • 1970-01-01
      • 2018-10-27
      • 2016-10-27
      • 2022-12-17
      相关资源
      最近更新 更多