I didn't select a VPC when creating a MySQL RDS database, so it created it inside an auto-generated "default" VPC. I'm now unable to add it to any of my pre-defined security groups, or access it from instances in my existing VPC. The obvious solution would be to relocate it to the proper VPC, but there doesn't seem to be any option to edit the VPC on the "Modify db instance" screen. Is there any way to select a different VPC, or is my only option to delete the db and re-create it inside the correct VPC?
Amazon has recently issued a press release announcing that you can now change the VPC for existing RDS instances:
Simple - take a snapshot of your current RDS instance and then restore that snapshot to a new instance in your VPC.
To avoid downtime when migrating to a new VPC you should set up Multi-AZ DB instances for your original RDS cluster so that the creation of a snapshot will not cause a brief I/O suspension. The cluster should also have binary logging enabled so that when you load your snapshot in the new VPC you can set up replication between the databases to restore any data that may have been inserted or updated after the snapshot was created.
Follow this guide from RDS docs
EDIT
I had to do this with RDS Aurora and had to make slight modifications to the above guide:
When restoring from an Aurora snapshot you cannot set the parameter groups so the instance gets the default parameters automatically. Once the instance is available change the parameters to include binary logging and reboot it.
Running
SHOW MASTER STATUS\G
will not give you the correct binary log file and position of the original db at the time the snapshot was taken, the reboot of the instance created a new binary log file. Instead runSHOW BINARY LOGS;
to find the previous log file and the file_size and use those values when setting up replication.