Skip to content

Instantly share code, notes, and snippets.

@taylor
Forked from nevernormal1/gist:356787
Created October 29, 2012 05:52
Show Gist options
  • Save taylor/3971825 to your computer and use it in GitHub Desktop.
Save taylor/3971825 to your computer and use it in GitHub Desktop.
db = rds.create_db_instance(
:db_instance_identifier => "[FILTERED]",
:allocated_storage => 100,
:db_instance_class => "db.m1.small",
:engine => "MySQL5.1",
:master_username => '[FILTERED]',
:master_user_password => '[FILTERED]',
:db_name => '[FILTERED]',
:availability_zone => 'us-east-1c'
)
require 'rubygems'
require 'aws'
rds = AWS::RDS::Base.new(
:access_key_id => '[our-amazon-access-key]',
:secret_access_key => '[our-amazon-secret-access-key]'
)
db.authorize_db_security_group(
:db_security_group_name => 'default',
:ec2_security_group_name => '[our-ec2-security-group]',
:ec2_security_group_owner_id => '[our-aws-account-number]'
)
> mysqldump old_db -u user -p > inventables.sql
> mysql rds_db -u user -p -h [RDS_connection_string] < inventables.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment