Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CloudFormation: Template format error: At least one Resources member must be defined

I am sure this template worked previously, but when I validate in the designer now it says:

12/5/2018, 9:41:47 AM - Template contains errors.: Template format error: At least one Resources member must be defined.

I can't figure out why. I have only the one resource, and it's defined?

{
    "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"
                }
            }
        }
    }
}
like image 377
JamesMatson Avatar asked Dec 13 '22 13:12

JamesMatson


1 Answers

Problem solved. Such a stupid one! I was on the 'Resources' tab when I was pasting in my CF template from VS Code. I needed to be in the 'Template' tab of the Stack designer in AWS Console. Ugh. I want to jump off a cliff O.O

like image 76
JamesMatson Avatar answered Jun 08 '23 21:06

JamesMatson