【发布时间】:2014-07-21 01:37:19
【问题描述】:
如何避免 cloudformation 模板之间的循环引用?
例如我的 Web 服务器有一个模板,我的数据库实例有另一个模板。模板数据库看起来像:
"Database": {
"Type":"AWS::RDS::DBInstance",
"Properties": {
// lots of other props
"VPCSecurityGroups": [ {"Ref":"DBSecurityGroup"} ]
}
},
"DBSecurityGroup" : {
"Type":"AWS::RDS::DBSecurityGroup",
"Properties": {
// lots of other props
"SecurityGroupIngress": [{... "SourceSecurityGroupId":{"Ref":"WebSecurityGroup"}}]
}
}
但在我的 Web 服务器模板中,我需要引用 DBSecurityGroup:
"WebServer": {
"Type":"AWS::EC2::Instance",
"Properties": {
// lots of other props
"SecurityGroups": [ {"Ref":"DBSecurityGroup"} ]
}
},
"WebSecurityGroup" : {
"Type":"AWS::EC2::SecurityGroup",
"Properties": {
// lots of other props
"SecurityGroupEgress": [{... "SourceSecurityGroupId":{"Ref":"DBSecurityGroup"}}]
}
}
如何避免模板之间的这些循环引用?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation