[英]Referencing !Ref DynamoDB table name in a AWS CloudFormation template
[英]How we can use same Tags into two AWS::DynamoDB::Table with in Cloudformation Template
我正在尝试使用 Cloud Formation Template 创建 Amazon DynamoDB 表。 所以我的问题是我可以使用参考在多个表中使用相同的标签吗?
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"Status": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "SId",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "SId",
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": "1",
"WriteCapacityUnits": "1"
},
"TableName": "Statuscf",
"Tags": [
{
"Key": "Application",
"Value": "BFMS"
},
{
"Key": "Name",
"Value": "EventSourcingDataStore"
}
]
}
},
"BMSHSData": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"TableName": "Billing.FmsDatacf",
"Tags": [{"Ref":"/Status/Tags"}]
}
}
}
请建议我如何在另一个表中使用相同的标签。 我正在使用 Like this "Tags": [{"Ref":"/Status/Tags"}]。
使用普通 CloudFormation 执行此操作的唯一方法是复制和粘贴。 因此,您必须“手动”复制所有表的标签。 唯一的自动化解决方案是通过开发CloduFormation 宏或自定义资源。 另一种选择可能是通过使用嵌套堆栈。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.