【发布时间】:2017-03-24 01:30:36
【问题描述】:
我有一个 DynamoDB 表,需要复制到不同的环境。管理表格的最佳方式是使用 CloudFormation 模板,以便脚本可以基于模板创建表格。鉴于表已经存在,我想知道是否可以为现有表生成 e 模板,有什么想法吗?在 google 上找不到太多...
模板看起来像这样:
"Resources": {
"CustomerTable": {
"Type" : "AWS::DynamoDB::Table",
"Properties" : {
"KeySchema": [
{
"AttributeName": "customerId",
"KeyType": "HASH"
}
],
"AttributeDefinitions": [
{
"AttributeName": "customerId",
"AttributeType": "N"
}
],
"ProvisionedThroughput" : {
"ReadCapacityUnits" : { "Ref": "CustomerReadCapacity" },
"WriteCapacityUnits" : { "Ref": "CustomerWriteCapacity" }
},
"TableName" : "customer"
}
}
}
【问题讨论】: