Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS cloudformation error: Template validation error: Invalid template parameter property

I am trying to create cloudformation template to use but I keep getting the above error. Here is snippet from my template:

"Mappings" : {
    "AWSInstanceType2Arch" : {
            "t1.micro" : { "Arch" : "64" },
            "m1.small" : { "Arch" : "64" },
            "m1.medium" : { "Arch" : "64" },
            "m1.large" : { "Arch" : "64" },
            "m1.xlarge" : { "Arch" : "64" },
            "m2.xlarge" : { "Arch" : "64" },
            "m2.2xlarge" : { "Arch" : "64" },
            "m2.4xlarge" : { "Arch" : "64" },
            "m3.xlarge" : { "Arch" : "64" },
            "m3.2xlarge" : { "Arch" : "64" },
            "c1.medium" : { "Arch" : "64" },
            "c1.xlarge" : { "Arch" : "64" },
            "cc1.4xlarge" : { "Arch" : "64HVM" },
            "cc2.8xlarge" : { "Arch" : "64HVM" },
            "cg1.4xlarge" : { "Arch" : "64HVM" }
        },
    "AWSRegionArch2AMI" : {
                "us-west-2": {"AMI": "ami-1b3b462b"}
         }
     },

  "Resources": {
    "Ec2Instance" : {
          "Type" : "AWS::EC2::Instance",
    "Properties": {
        "ImageId": { "Fn::FindInMap": [ "AWSRegionArch2AMI", { "Ref": "AWS::Region" },
        { "Fn::FindInMap": [ "AWSInstanceType2Arch", {"Ref": "InstanceType"}, "Arch" ] } ] },
            "InstanceType": {"Ref": "InstanceType"},
            "SecurityGroups": [ { "Ref": "SecurityGroups"} ],
            "KeyName": { "Ref": "KeyName" },
            "Tags": [ { "Key": "Name", "Value": { "Ref": "InstanceName" } } ] }
    },

I have more happening on the bottom such as a bash script to be executed except I can't get passed this single issue. What am I missing?

like image 803
Gabriel Avatar asked Aug 28 '14 20:08

Gabriel


1 Answers

I came across this issue while looking for a solution to the same error message.

In my case I was getting the error:

Invalid template parameter property 'Properties'

This was because I had placed a resource definition in the "Parameters": { } section of the template instead of in the "Resources": { } section.

The error message is like that because Resources have a "Properties" section, but "Properties" are not valid for Parameters.

like image 189
Andrew Davison Avatar answered Oct 04 '22 06:10

Andrew Davison