agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 54 forks source link

deploymentBucket should defaults to reading from core #116

Open vicary opened 2 years ago

vicary commented 2 years ago

Serverless is able to generate its own deployment bucket and this plugin should be able to read from it when not explicitly specified by users.

agutoli commented 1 year ago

It's a bit more complicated than it seems. That library runs before the hook that creates the default bucket, and I tried that before and I got a few issues that I can't remember now, but I reckon we need to attach the layer before before:package:initialize because serverless also check for changes (like when layer arn is attached/updated), for instance. So, when this plugin identifies a new change, it attaches the new arn to each function, and then sls is responsible to the handler after that. Not saying its impossible, but it probably will require a re-think on this library which probably makes more sense to do on next implementation maybe on serverless-layers 3.0

vicary commented 1 year ago

@agutoli please take your time. We will fallback to a static bucket for existing projects, our future projects would definitely benefit when 3.0 is out.