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

Compatibility with serverless-deployment-buckets #55

Closed adambartholomew closed 4 years ago

adambartholomew commented 4 years ago

I've been having issues with the hook order between this plugin and serverless-deployment-bucket.

The serverless-deployment-bucket plugin creates the S3 deployment bucket for the deployment, and is performed on the hook before:package:setupProviderConfiguration.

serverless-layers fires much earlier in the process during before:package:initialize. The layer is attempted to be uploaded before the bucket can be created, and the exception halts the process.

Is there a more appropriate hook for uploading the layer after the provider is fully configured?