Open ianwremmel opened 11 months ago
Hey @ianwremmel π sorry for the delay on this! Do you recall if you found a solution for this issue by any chance?
Hi @nikolasburk I am working on implementing Prisma in a SAM application to enable queries with PostgreSQL. I came across the same documentation mentioned in the post, but as someone with limited experience in CloudFormation or AWS SAM, I find the process of setting it up in a layer a bit challenging. I read this post, Deploying Prisma with AWS Lambda Layers in CDK, as well as this one on deploying Prisma with Serverless, but they donβt fully work for local testing scenarios. Do you have any solutions or documentation that might help with a local setup?
Mostly, I just chose to ignore those instructions. As far as I can tell, the prisma schema file is not, in fact, necessary at runtime. It's been to long since I did most of this, so I don't remember the details, but this is my prisma config:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
previewFeatures = ["driverAdapters", "views"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
My assumption is that, by using prisma-client-js
, I don't need to the schema file or the compiled .node.so
file.
The instructions at https://www.prisma.io/docs/guides/deployment/serverless/deploy-to-aws-lambda#loading-required-files say to add the following to each function's Metadata.BuildProperties:
However, in so doing, sam build fails with
and