我正在尝试在现有的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
我很可能会错过一些简单的东西,但无法弄清楚
答案 0 :(得分:4)
弄明白了,在-
部分AttributeName
附近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 # <-- stray dash was here
Enabled: true
ProvisionedThroughput:
ReadCapacityUnits: 2
WriteCapacityUnits: 2
inline-block