2
votes

I am trying to Create a new Sql server - RDS instance (with more storage ) from an existing snapshot ID. Below is my CloudFormation template that's throwing the error "Template contains errors.: Invalid template property or properties [Type, Properties]"

"MyDB" : {
  "Type" : "AWS::RDS::DBInstance",
   "Properties" : {
      "DBName" : { "Ref" : "NSGlobal" },
      "DBSnapshotIdentifier":"rds:xxxxxxxxx-2016-07-13-17-00",
      "AllocatedStorage" : "400",
      "DBInstanceClass" : "db.m2.xlarge",
      "EngineVersion" : "11.0"
   }
}

I copied this template from the AWS site http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-masterusername and tailored it. what's the problem ?

2
Remove "AWSTemplateFormatVersion": "2010-09-09" and then check it will work the template version is not a AWS Resource property thats why the error - error2007s
That's giving Template contains errors.: Template format error: unsupported type or structure. (line 1, column 1) - hakuna
Can you paste your edited template? - error2007s
Updated in the question - hakuna
Is this RDS a Mysql? - error2007s

2 Answers

1
votes

This worked:

{
    "AWSTemplateFormatVersion" : "2010-09-09",
    "Resources" : {
        "DBInstance" : {
            "Type": "AWS::RDS::DBInstance",
            "Properties": {
                "DBInstanceClass" : "db.m2.xlarge", 
                "AllocatedStorage" : "400", 
                "MasterUsername" : "myusername", 
                "MasterUserPassword" : "mypassword", 
                "DBSnapshotIdentifier":"xxxxxxxx-2016-07-13-17-00" 
            }
        }
    }
}

MasterUserName and MasterUserPassword are not mandatory, the template will be valid even without them.

Refer this thread for more information : Creating SQL RDS instance in CloudFormation

1
votes

You are missing the Engine property use the template below. This are the valid options for engine.

Valid Values: MySQL | mariadb | oracle-se1 | oracle-se | oracle-ee | sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web | postgres | aurora

        "MyDB" : {
          "AWSTemplateFormatVersion" : "2010-09-09", 
          "Resources" : { 
          "DBInstance" : { 
          "Type": "AWS::RDS::DBInstance", 
          "Properties": { 
             "DBInstanceClass" : "db.m2.xlarge", 
             "AllocatedStorage" : "400", 
             "MasterUsername" : "myusername", 
             "MasterUserPassword" : "mypassword", 
             "DBSnapshotIdentifier":"xxxxxxxx-2016-07-13-17-00" 
         } 
      } 
    } 
}