AWS CloudFormation:模板格式错误:必须定义至少一个Resources成员

时间:2018-12-04 22:49:17

标签: amazon-cloudformation

我确定此模板以前可以工作,但是现在在设计器中验证时,它说:

  

12/5/2018,9:41:47 AM-模板包含错误。:模板格式   错误:必须定义至少一个Resources成员。

我不知道为什么。我只有一个资源,它的定义是?

{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Metadata": {
        "AWS::CloudFormation::Designer": {
            "7edb75f7-c18f-41d8-972e-959e2326ffda": {
                "size": {
                    "width": 60,
                    "height": 60
                },
                "position": {
                    "x": 255,
                    "y": 217
                },
                "z": 0,
                "embeds": []
            }
        }
    },
    "Resources": {
        "DemoEc2Stack": {
            "Type": "AWS::EC2::Instance",
            "Properties": {
                "KeyName": "InSiteAutoScaleKey",
                "DisableApiTermination": false,
                "ImageId": "ami-redacted",
                "InstanceType": "t2.micro",
                "Monitoring": false,
                "SecurityGroupIds": [
                    "sg-redacted"
                ],
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": "api-demo-cloudformed"
                    }
                ]
            },
            "Metadata": {
                "AWS::CloudFormation::Designer": {
                    "id": "7edb75f7-c18f-41d8-972e-959e2326ffda"
                }
            }
        }
    }
}

1 个答案:

答案 0 :(得分:3)

问题解决了。真蠢!从VS Code粘贴CF模板时,我在“资源”选项卡上。我需要进入AWS Console中Stack设计器的“模板”标签。啊。我想从悬崖上跳下来

相关问题