DEV Community

Discussion on: How to move your Postgres database from Heroku to AWS RDS [Detailed Guide]

Collapse
 
andrewdmay profile image
Andrew May

The idea of a database being publicly accessible sends shivers down my spine.

If the application is also moving to AWS then I would recommend putting the database in private subnets so that it can never be public (and also locking down your security group so that it's only accessible to the security group of the application that will be using it). If you're dumping the data to a file you can scp it up to a bastion host in your VPC to load it to the private cluster (obviously this assumes downtime).

If you must have the database public for some time, you can always snapshot it after the data load and use the snapshot to create a new private instance in different subnets after the load is completed.

Setting SSL does certainly help, but I'm paranoid enough to not trust that by itself.