【发布时间】:2019-03-28 12:40:30
【问题描述】:
我正在尝试使用 cloudFormation 模板创建 EC2 实例。 为此,我在 JSON 下方编写并尝试使用 CloudFormation“将模板上传到 Amazon S3”中的选项上传 json。 但上传 JSON 后我收到错误:
模板验证错误:模板的输出块中未解决的资源依赖项 [Ec2Instance]。
请告诉我这里出了什么问题?
{
"Description": "Create an EC2 instance running the latest amazon Linux AMI.",
"Parameters": {
"KeyPair": {
"Description": "The EC2 key Pair to allow SSH access to the instance",
"Type": "String"
}
},
"Resources": {
"EC2Instance": {
"Properties": {
"ImageId": "ami-9d23aeea",
"InstanceType": "t2.micro",
"KeyName": {
"Ref": "KeyPair"
}
},
"Type": "AWS::EC2::Instance"
}
},
"Outputs": {
"InstanceId": {
"Description": "The InstanceId of newly created EC2 instance",
"Value": {
"Ref": "Ec2Instance"
}
}
},
"AWSTemplateFormatVersion": "2010-09-09"
}
【问题讨论】:
标签: json amazon-web-services amazon-ec2 amazon-cloudformation