:rock: Trying to find the best way to handle creat...
# sst
j
🪨 Trying to find the best way to handle creating and connecting to RDS Aurora PostgreSQL (serverless) database instance. Reading this thread and the SST docs it seems like it is not yet supported. Requirements are: 1. To be able to create clusters/databases per GIT branch/PR (so would need to provision it at the same time as the rest of the stack. 2. Connect to it locally when running SST in debug (happy for this to be public with no VPN to the VPC). Want to avoid having to run a Postgres instance locally. 3. Security in live is obviously important - is "AWS Secrets Manager" the way to go to handle connections? If so how would this play with the stack creation? Any thoughts or pointers welcome.
f
Hey @Jack Fraser, I’ve seen ppl using RDS with SST. The link to the doc you shared was for the
sst.Table
construct. That’s for DynamoDB. SST doesn’t have a construct for RDS. The code snippet I wrote in the thread you shared uses the native CDK constructs to create the VPC and RDS cluster. You need do something similar.
As for the requirements:
1. To be able to create clusters/databases per GIT branch/PR
I would use the branch name and PR name as the SST stage name. ie.
Copy code
sst deploy --stage pr241
2. this to be public with no VPN to the VPC
You can place the cluster in the public subnets in the dev stage and private subnets in the prod stage?
3. is “AWS Secrets Manager” the way to go to handle connections?
I haven’t used RDS. AFAIK, the best practice is letting Secrets Manager to auto generate a password on stack creation? I might be wrong on that.