Open vicary opened 2 years 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
@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.
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.