【发布时间】:2017-08-10 22:15:52
【问题描述】:
我想通过 CloudFormation 为我新创建的表启用 TTL。我尝试了以下方法无济于事:
{
"Resources" : {
"mytable" : {
"Type" : "AWS::DynamoDB::Table",
"Properties" : {
"TableName" : "my_table",
"ProvisionedThroughput" : {"ReadCapacityUnits" : 1, "WriteCapacityUnits" : 5},
"KeySchema" :
[
{"AttributeName" : "user_email", "KeyType" : "HASH"},
{"AttributeName" : "datetime", "KeyType" : "RANGE"}
],
"AttributeDefinitions": [
{"AttributeName" : "user_email", "AttributeType" : "S"},
{"AttributeName" : "datetime", "AttributeType" : "S"}
],
"TimeToLiveDescription": {
"AttributeName": "expire_at",
"TimeToLiveStatus": "ENABLED"
}
}
}
}
我使用了我从this doc 获得的 TimeToLiveDescription。
尝试创建堆栈时出现以下错误:
Encountered unsupported property TimeToLiveDescription
【问题讨论】:
-
我最初也是这样做的。属性 TimeToLiveDescription 是描述表的输出,而不是创建表时资源声明的一部分。命名有点混乱。
标签: amazon-web-services amazon-dynamodb amazon-cloudformation