【问题标题】:CloudFormation: Unresolved resource dependencies [Ec2Instance] in the Outputs block of the templateCloudFormation:模板的输出块中未解决的资源依赖关系 [Ec2Instance]
【发布时间】: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


    【解决方案1】:

    我想你只是打错字了。 EC2Instance 在您的资源列表中,Ec2Instance 在您的输出中。

    【讨论】:

    • @tyron 你能告诉我怎么做吗?
    • @vickey99 只需单击答案左侧显示在当前投票数下方的灰色“复选标记”。
    猜你喜欢
    • 2020-01-10
    • 2020-03-30
    • 2020-05-15
    • 2020-03-25
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 2018-11-14
    • 2021-01-19
    相关资源
    最近更新 更多