Hello, I'm trying to deploy my Medusa backend to AWS with Terraform and I have most of the infrastructure configured. I'm running on Fargate 1.4 and Postgres 17.2.
- When I go run the
npx medusa:migratescript during initialization I've been receiving the errorno pg_hba.conf entry for host. - My RDS instance has
force_ssl = trueso when I added sslmode to my DATABASE_URL secretpostgres://user:pass@host:port/medusa?sslmode=requirethe error changed toself-signed certificate in certificate chain. - I added my the cert file for my region to the docker image under
/certs/region.pemand added it to the DATABASE_URL like so?sslmode=require&sslrootcert=/certs/region.pem" - The connection cannot find the file, even though I confirmed the location of the file in the docker image.
- I also tried a lot of the information on Medusa docs:
projectConfig: {
databaseDriverOptions: process.env.NODE_ENV !== "development" ?
{ connection: { ssl: { rejectUnauthorized: false } } } : {}
// ...
}
...
Note: Make sure to add to the end of the database URL ?ssl_mode=disable as well when disabling rejectUnauthorized.
I tried this with both ?sslmode=disable and the suggested but this seems to suggest disabling SSL in production, neither worked either way.
The GitHub issues/discussions about this are totally silent for V2 config so I'm asking here. Has anyone managed to successfully set this system up that can offer guidance?