Is there a recommended way to create an aws lambda layer?

I'm bumping up to size limits on the layer. I have only 3 prisma packages in the layer and it already exceeds the limit. I've tried a few solutions before, but none have worked and basically just ended splitting each package into it's own layer, which is cumbersome to say the least side note: do we have a way to create one package for multiple databases? i assume that would reduce the size but i really have no idea
6 Replies
Prisma AI Help
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
RaphaelEtim
RaphaelEtim23h ago
Hi @thejacer87 Can you take a look at this similar issue to see how another user solved it.
GitHub
Prisma lambda package size still seems large even after latest chan...
Bug description I've been following the serverless and lambda enhancements and performance improvements for quite some time that you all have made but I still seem to notice that my lambda even...
RaphaelEtim
RaphaelEtim23h ago
do we have a way to create one package for multiple databases?
At the moment, i do not know of one.
thejacer87
thejacer87OP13h ago
ok i think im making some progress im trying to make some hardlinks for the engine files instead of it having mutiple copies one question i have, the prisma generate is automatically building the debian engine (im on ubuntu so that makes sense) even thought i dont have "native" as one of my binary targets i only need the rhel version cuz that's what aws-lambda's need
thejacer87
thejacer87OP12h ago
heres what get's generated for me i have 3 different "client" packages they all have the rhel engine but for w/e reason @prisma still creates the debian engine even though all three of my schema files just have this:
binaryTargets = ["rhel-openssl-3.0.x"]
binaryTargets = ["rhel-openssl-3.0.x"]
i do get this warning while building:
Warning: Your current platform `debian-openssl-3.0.x` is not included in your generator's `binaryTargets` configuration ["rhel-openssl-3.0.x"].
To fix it, use this generator config in your schema.prisma:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
}
Warning: Your current platform `debian-openssl-3.0.x` is not included in your generator's `binaryTargets` configuration ["rhel-openssl-3.0.x"].
To fix it, use this generator config in your schema.prisma:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
}
No description
thejacer87
thejacer87OP12h ago
i think i would like to avoid that warning and not even have it build debian engine

Did you find this page helpful?