Shell script to start Amazon RDS in different regions

4 Apr

A shell script to create Amazon RDS instances in different data center regions.

regions=( us-east-1 us-west-2 us-west-1 eu-west-1 ap-southeast-1 ap-northeast-1 sa-east-1 )

for REGION in ${regions[@]}
	rds-create-db-instance test  --allocated-storage  10  --db-instance-class db.m1.large  --engine MySQL    --master-user-password  testtest  --master-username test --region $REGION
	rds-authorize-db-security-group-ingress default --cidr-ip --region $REGION

sleep 60

for REGION in ${regions[@]}
	rds-describe-db-instances --region $REGION

sleep 300

for REGION in ${regions[@]}
	rds-delete-db-instance test --skip-final-snapshot  --region $REGION
	rds-revoke-db-security-group-ingress default --cidr-ip --region $REGION

UPDATE: Corrected “rds-describe-db-instances” command and CIDR range, added all AWS regions on April 25 2012.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: