本文介绍了传递参数的嵌套云的形成模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我打电话CFT2从CFT1,我路过parameters.I名单最近才知道,我们不能传递的参数用逗号分隔的列表,所以我期待如何实现这一解决方案。这是我的CFT1:
I am calling CFT2 from CFT1 and I am passing a list of parameters.I recently came to know that we cant pass comma delimited list of parameters, so I am looking how to achieve that solution . This is my CFT1 :
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Top Stack",
"Resources": {
"ChildStack01": {
"Type" : "AWS::CloudFormation::Stack",
"Properties" : {
"TemplateURL": "https://s3.amazonaws.com/tbdchef/frontend1.json",
"Parameters": {
"AvailabilityZone1a": {
"Default": "us-east-1a",
"Description": "us-east-1a",
"Type": "String"
},
"AvailabilityZone1b": {
"Default": "us-east-1b",
"Description": "us-east-1b",
"Type": "String"
},
"ChefDevSNSTopic": {
"Description": "ARNforSNSTopic",
"Type": "String",
"Default": "arn:aws:sns:us-east-1:093937234853:Enterprise_Monitoring_SNS_Horizontal"
}
},
"TimeoutInMinutes" : "5"
}
}
}
}
我得到的错误:
The error I am getting :
Value of property Parameters must be an object with String (or simple type) properties
有没有一种方法,我可以通过这些值来CFT2?
Is there a way I can pass these values to CFT2?
推荐答案
您可以用这种方式传递这个
You can pass this in this way
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
},
},
"Resources": {
"ChildStack01": {
"Type" : "AWS::CloudFormation::Stack",
"Properties" : {
"TemplateURL": "https://s3.amazonaws.com/tbdchef/frontend1.json",
"Parameters": {
"KName": { "Ref" : "KeyName" }
}
}
}
}
}
然后再界定CFT2参数KName
And then again defining the parameter KName in CFT2
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"KName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
}
}
}
这篇关于传递参数的嵌套云的形成模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!