Roots Discourse

Setting up trellis with remote rds on aws


#1

Hi, I am in the process of setting up an existing wordpress site on trellis and bedrock. I have been reviewing the documentation and don’t see much on remote database configuration. I have seen quite a few threads about the topic, but a lot of them seem outdated and not very descriptive on the entire process.

So here is where i am at, i got trellis running a development server and have setup an ec2 instance on aws that i am provisioning and deploying to as my production server. Out of the box trellis sets up the database on the local machine as expected. So what file(s) or vars, do i need to be looking at to change the production server to connect to the remote database, and skip that entire process being the site already has an existing database? I see in the site folder a .env with configurations, but to my knowledge that does not get pushed to the production server. Also my development server will not be connected to a remote database so the configurations will be different. Thanks!


#2

As mentioned here, you can set the db_host var to point to your remote host.


#3

Thanks @codepuncher! Also that information is obviously sensitive data (db_host, db_pass, db_name, etc.), so how would i go about placing that in the vault.yml file, so it’s all encrypted and then populating it in the wordpress_sites.yml file? Or does it do that automatically, if i place the information in the vault.yml file.


#4

The contents of vault.yml for any environment is plaintext unless you follow the documentation instructions to encrypt them (which you can find here).

Give it all a go; trial and error is a good way to learn things IMO.