AWS RDS with SSL does not connect to Mastra/Next,js app
Hey team,
I’m deploying my app to AWS using RDS with SSL (per my customer’s requirements). The app runs in ECS and connects to the RDS instance over an internal network. I’ve tried multiple approaches to get the SSL connection working, but it consistently fails on AWS—even though the same setup works both locally and when deployed to GCP Cloud SQL. This makes me suspect there may be a bug involved.
My connection string from my docker compose file is:
Error 1: I get this error with out changing anything that is describe below:
2025-11-07T00:48:12.435-08:00 app b3fcfdd92783423294d7609ef1a62b2d Error creating table mastra_workflow_snapshot: [error: no pg_hba.conf entry for host "10.0.167.166", user "postgres", database "postgres", no encryption]
2025-11-07T00:48:12.435-08:00 app b3fcfdd92783423294d7609ef1a62b2d Error creating table mastra_workflow_snapshot: [error: no pg_hba.conf entry for host "10.0.167.166", user "postgres", database "postgres", no encryption]
Error 2: This one appear after appending to the connection string sslmode=require to be