Hi team, We are using serverless stack with monore...
# help
s
Hi team, We are using serverless stack with monorepo in our project, so we ended up with more than 4KB environment variables size and Lambda couldn't allow it. Is there is a way we can setup env variables for each stack?
r
The limit is per lambda so look at how you're allocating the env vars to each lambda, you have defaults that are getting assigned to every one that you don't need
f
That’s right. @Swaroop are you setting a lot of environments via the
setDefaultFunctionProps
call? Or are there any environments that hold lengthy values?
s
yes, @Frank we are using lengthy values related to Algolia in in
addDefaultFunctionEnv
to set environment variables across the functions
I think specifying required environment variable to each lambda as @Ross Coundon said, will get rid of this problem. I can do that using like this: https://docs.serverless-stack.com/storage#:~:text=new%20Function(this,%7D)%3B