SG *_* 86 11 templates json amazon-web-services aws-cloudformation
鉴于我有这个示例模板:
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Mappings" : {
"RegionMap" : {
"us-west-1" : { "AMI" : "ami-655a0a20" },
...
}
},
"Resources" : {
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
...
},
"DependsOn" : "myDB"
},
"myDB" : {
"Type" : "AWS::RDS::DBInstance",
"Properties" : {
...
}
},
"myDB2" : {
"Type" : "AWS::RDS::DBInstance",
"Properties" : {
...
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
是否可以以任何方式指定多个DependsOn?想要有一些想法会很棒:
"DependsOn" : ["myDB", "myDB2"]
Run Code Online (Sandbox Code Playgroud)
什么是正常的方式?
E.J*_*nan 15
是,
DependsOn属性可以采用单个字符串或字符串列表.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
句法:
"DependsOn":[String,...]
这个答案首先出现在谷歌中,所以我将包括如何在 YAML 中执行多个依赖属性,我在这个答案中找到了。
AnotherProductionResource:
Type: AWS::CloudFormation::Stack
Condition: ISProduction
DependsOn:
- AResource
- MyProductionResource
Properties:
[...]
Run Code Online (Sandbox Code Playgroud)
小智 5
是的,“DependsOn”可以接受多个字符串。我在下面列出了一个例子:
"DependsOn": [ "S3BucketAppElbLogs", "ElbLogAppBucketPolicy" ]
归档时间: |
|
查看次数: |
8913 次 |
最近记录: |