I'm trying to connect to my RDS instances (one for staging and one for production) by adding the EC2 servers in resource manager -- all good -- but I can't seem to add the databases. Trying to add a database to the custom servers I added doesn't work? I'm actually not sure what I'm supposed to do. I can't find any docs that tell me what to do. Can someone point me in the right direction?
I've been right-clicking on Services, choosing Add Service, then Database, then Postgres. I give it the name of my RDS instance and attempt to fill out the properties window below but I think those are for docker, at least that's what the info tooltip says (Name: Docker service name). I'm not using Docker for staging or production, just development locally.
Is this how I'm supposed to do this? I'm not even sure how to fill out all of the fields. No matter what I do, I just get the same yellow warning triangle.
How do I find the database volume name? Should the database name be the same as my RDS instance name? I've entered the database password, port, etc, (not in this screenshot)
I tried to run it, and it's expecting a Docker container. Does that mean I can only add Docker databases?
Is there something else I should be doing? I've tried to add the servers to the targets, but the server dropdown is empty, even though I've added them to Resource Manager.
Otherwise if you want just one project and a database just specify it in the project target options. This is preferred.
As you mentioned that you are on AWS EC2 instance make sure you run the server check from the context menu to make sure first all needed docker services are installed well. Also the server should run Ubuntu as this is what we support.
As we do not support AWS out of the box in resource manager, I would really suggest digital ocean or hetzner for much better and cheaper providers if you can choose.
I'm only using Docker locally, not for my staging and production environments. I don't think I understand what you're saying. I'm trying to connect remote RDS instances in my staging and production targets. Neither server has docker machines. You mean I don't add the database to the servers I added in Resource Manager first, just directly into the targets? Because the servers I added in the resource manager do not show up in the dropdown for database server in the target setup. Noted on Ubuntu. I think that might be the issue. I'll report back
Adding a DB in resource manager is to add it as a service on the machine where your site’s files are hosted. If you’re connecting to a database that already exists open Database Manager and add a new connection:
Then enter the AWS endpoint details and DB credentials:
@bpj are you saying i should connect to my production and staging databases through the Database Manager? I was using the Resource Manager because I’m trying to connect to my staging and production environments. My development environment is all set up and fine. @George said to specify in the project target options. So, does this mean that i don’t need to connect to a server in the Resource Manager at all? I’m confused.
It is my understanding that specifying the database in resource manager is usually for when you want to use the same server for DB and hosting the site - each service residing in its own Docker container
In your case you want to connect the site to an external RDS DB. You can set this up in targets as George suggested (it looks like more options have been added there to allow custom connections since I last looked) or via DB Manager, which is how I have always done it
But just so I’m clear, connecting via Database Manager can be done for different targets? So when I make changes to the development schema, those changes can be deployed to the staging and production schemas?
@George, I'm using Redis to cache my RDS. If I add the database connection directly in the targets, the Redis portion doesn't allow a custom connection. Should I ignore that and put the Redis part in my environment variables?
You can also enable Redis on the target settings for Redis per target, or not when using external Redis but then you need to specify the Redis url in the server connect global options.
Enabling Redis on the target options only allows for Docker or Cloud Database. Should I just leave it as Docker, even though I'm not deploying to a Docker machine?
I think I'm still confused about this part. Am I adding the two databases to Database Manager, Target settings, or both? And if I'm adding them to the Database Manager, how do I choose the one I'm deploying to based on the target? For example, if I'm deploying to staging, how do I make sure I'm deploying to the staging database and not the production database? Also, the Database Manager lets you connect over SSH but the target settings don't. At this point, I still don't know what I should be doing.