【发布时间】:2015-04-17 00:46:06
【问题描述】:
"dbxSG":
{
"Type": "AWS::EC2::SecurityGroup",
"Properties":
{
"GroupDescription": "Enable dbX Access",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "0.0.0.0/0"
}
]
}
},
"dbxSGIngress" :
{
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties":
{
"GroupName": { "Ref": "dbxSG" },
"IpProtocol": "tcp",
"FromPort": "0",
"ToPort": "65535",
"SourceSecurityGroupName": { "Ref": "dbxSG" }
}
},
如何在上面的 json 文件中添加多个安全组名称? “dbxSG”名称多次引用。我想再添加一个具有新名称的安全组。如何添加?
【问题讨论】:
-
这并不完全合理。您创建了单个安全组的递归循环。您还将 JSON dict/hash 与 JSON 数组混淆。您是否遇到错误,这就是您要解决的问题?或者你想使用更多
SourceSecurityGroupNames? -
是的,我想使用更多的安全组名称..这应该与头实例相关联..如何实现..?
标签: amazon-web-services amazon-cloudformation aws-security-group