【发布时间】:2020-08-16 11:29:54
【问题描述】:
我正在 cloudformation 中创建一个表格:
"MyStuffTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"TableName": "MyStuff"
"AttributeDefinitions": [{
"AttributeName": "identifier",
"AttributeType": "S"
]},
"KeySchema": [{
"AttributeName": "identifier",
"KeyType": "HASH",
}],
"ProvisionedThroughput": {
"ReadCapacityUnits": "5",
"WriteCapacityUnits": "1"
}
}
}
稍后在 cloudformation 中,我想将记录插入到该表中,如下所示:
identifier: Stuff1
data: {My list of stuff here}
并将其插入到下面代码中的值中。我在某处看到了一个使用Custom::Install 的示例,但我现在找不到它,也找不到任何关于它的文档。
所以这就是我所拥有的:
MyStuff: {
"Type": "Custom::Install",
"DependsOn": [
"MyStuffTable"
],
"Properties": {
"ServiceToken": {
"Fn::GetAtt": ["MyStuffTable","Arn"]
},
"Action": "fields",
"Values": [{<insert records into this array}]
}
};
当我运行它时,我得到了这个Invalid service token。
所以我没有做正确的事情试图引用表来插入记录。我似乎在 Custom::Install 上找不到任何文档,所以我不确定这是通过 cloudformation 插入记录的正确方法。我似乎也找不到有关通过 cloudformation 插入记录的文档。我知道这是可以做到的。我可能错过了一些非常简单的东西。有什么想法吗?
【问题讨论】:
标签: amazon-web-services amazon-dynamodb amazon-cloudformation