By Neil Hastings
One of the main objectives I was looking to accomplish was to automate processes. So I focused on one the easiest but most repetitive tasks in setting up CloudFactor: creating the SimpleDB domains. CloudFactor has no install mechanism, as it’s a hosted product, and it expects certain SimpleDB domains to exist with certain data. The configurability of the product goes way beyond app building. The behavior of CloudFactor depends on what’s stored in these domains. However creating these tables is a manual process. Adding data to these tables is also a manual process. I always say if you do something more than 3 times it’s time to automate! So here’s how I did just that.
Using the power of CloudSpokes, I had a ruby script created that could copy SimpleDB domains and tables. I took the outcome from CloudSpokes, cleaned it up and put it to use. It’s been so successful that Appirio has decided to make it available by releasing the AWS SimpleDB Copy utility as open source.
Aws_sdb_copy is configured via a yaml file. Just enter your AWS access key and secret key, then setup the domain map. Enter the source domain, destination domain and any AWS compatible where clause and the domain and data that matches that table will be copied.
Sample config.yml file.
where_clause: “score > ’60′”
Run “ruby aws_sdb_copy” and the magic will happen. Please let me know if you find this script useful and if you come across any issues, please log them in GitHub.