我正在通过Java Eclipse创建Amazon Stack。
低于代码行的代码将引发错误
csr.setTemplateURL("https://s3.amazonaws.com/cloudformation-templates-us-east- 1/AutoScalingMultiAZSample.template");我得到的错误是:
捕获异常:参数: KeyName必须有值(服务:AmazonCloudFormation,状态码: 400,错误码:ValidationError,请求ID: 9363d711-3535-11e4-8cf2-913ef42879cb)响应状态码:400
我的json模板url是https://s3.amazonaws.com/cloudformation-templates-us-east-1/AutoScalingMultiAZSample.template
请在这方面提供帮助,以检测错误的确切来源。
发布于 2014-09-06 04:24:03
好的,我试着使用在线验证器来验证你的json模式。
http://jsonlint.com/
我只是复制了您的json模式并粘贴到那里。它在第1行显示了无效的模式预期{。好的,我必须在你的模式之间放上左括号和右括号。但它再次给出了错误。最后一行上的额外括号}。所以我不得不把它取下来。然后对json模式进行了验证。这意味着在您的架构中的某个地方,您放置了一个额外的右括号。
我认为你犯错的地方是:
"InstanceSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Enable SSH access and HTTP from the load balancer only",
"SecurityGroupIngress" : [ {
"IpProtocol" : "tcp",
"FromPort" : "22",
"ToPort" : "22",
"CidrIp" : { "Ref" : "SSHLocation"}
},
{
"IpProtocol" : "tcp",
"FromPort" : { "Ref" : "WebServerPort" },
"ToPort" : { "Ref" : "WebServerPort" },
"SourceSecurityGroupOwnerId" : {"Fn::GetAtt" : ["ElasticLoadBalancer", "SourceSecurityGroup.OwnerAlias"]},
"SourceSecurityGroupName" : {"Fn::GetAtt" : ["ElasticLoadBalancer", "SourceSecurityGroup.GroupName"]}
} ]
}
}//Extra Bracket i think so
},
"Outputs" : {
"URL" : {
"Description" : "The URL of the website",
"Value" : { "Fn::Join" : [ "", [ "http://", { "Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]}]]}
}
}
}https://stackoverflow.com/questions/25693041
复制相似问题