Take a snapshot of your existing database, either manually, using the CLI or PowerShell, taking note of the DBSnapshotIdentifier.
Using PowerShell it looks like this:
New-RDSDBSnapshot -DBSnapshotIdentifier "NameOfYourNewSnapshot" -DBInstanceIdentifier "YourExistingDbIdentifier"
Okay, now you have a snapshot, you need to change your CloudFormation template to use the DBSnapshotIdentifier.
Change your existing template to create a SqlServer database and specify a new property, DBSnapshotIdentifier:
"MyDB" : {
"Type" : "AWS::RDS::DBInstance",
"Properties" : {
"DBSecurityGroups" : [
{"Ref" : "MyDbSecurityByEC2SecurityGroup"}, {"Ref" : "MyDbSecurityByCIDRIPGroup"} ],
"AllocatedStorage" : "20",
"DBInstanceClass" : "db.t2.micro",
"Engine" : "sqlserver-ex",
"MasterUsername" : "MyName",
"MasterUserPassword" : "MyPassword",
"DBSnapshotIdentifier" : "NameOfYourNewSnapshot"
}
}
That should be it, when you run your stack it will drop and re-create your database from your snapshot, so be sure to cater for the down time.
Docs:
http://docs.aws.amazon.com/powershell/latest/reference/Index.html
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsnapshotidentifier