https://serverless-stack.com/ logo
#help
Title
# help
d

David Tsai

04/04/2022, 4:20 PM
Hello all, I'm new to SST and am looking to utilize it to deploy a Next.js app using
NextjsSite
plugin. However, my app utilizes RDS as its datastore behind a VPC and as far as I can tell it's not possible for Lambda@EDGE to connect to RDS behind a VPC. Is this true? If so, is there another recommended way I could deploy my app securely?
t

thdxr

04/04/2022, 4:20 PM
is your app already deployed and running?
reason I ask is the best way to use RDS is with our
sst.RDS
construct which creates a serverless rds cluster with Data Api
d

David Tsai

04/04/2022, 4:20 PM
Not deployed, just running it locally right now, I've got my RDS instance setup tho
t

thdxr

04/04/2022, 4:21 PM
Data API is an http based sql interface that can auth through IAM
and you can query it with a tool like
kysely
+ our
kysely-data-api
connector
d

David Tsai

04/04/2022, 4:21 PM
I see
My app also uses prisma as an ORM, are you able to use kysely as the data connector driver?
t

thdxr

04/04/2022, 4:27 PM
prisma's architecture is poorly designed for serverless which is why we recommend kysely instead
you get similiar typesafe query building abilities without codegen
There's this issue: https://github.com/prisma/prisma/issues/1964 You can probably get it all working if you use Prisma Data Proxy
d

David Tsai

04/04/2022, 4:30 PM
I see got it, thank you for the info and help!
4 Views