amazon web services - AWS RDS Cloud formation template for SQL Server -
i'm pretty new using aws stuff. wanted take snapshot of current sql server instance , create instance same snapshot (so existing databases , data gets migrated) , more storage capacity using aws cloud formation.
i saw on amazon https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/rds_mysql_with_read_replica.template
but couldn't tailor needs. don't want ec2 instance , things. existing snapshot id , new sql server rds instance details cloned snapshot id
take snapshot of existing database, either manually, using cli or powershell, taking note of dbsnapshotidentifier.
using powershell looks this:
new-rdsdbsnapshot -dbsnapshotidentifier "nameofyournewsnapshot" -dbinstanceidentifier "yourexistingdbidentifier"
okay, have snapshot, need change cloudformation template use dbsnapshotidentifier.
change existing template create sqlserver database , specify 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 it, when run stack drop , re-create database snapshot, sure cater 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
Great blog... This blog clearly show the importance of AWS daily snapshot and how it work. Thanks for sharing
ReplyDelete