serverless-layers
serverless-layers copied to clipboard
Incompatible with dynamic deployment buckets
If no deployment bucket is configured, sls deploy
will create a bucket dynamically, but this plugin does not pick up that bucket name and instead fails the entire deploy. This plugin would be very useful to package node_modules
as a dedicated layer and slim down individual function packages.
I'd really love to see this feature. As is it right now, I can't use this plugin, as it would mean creating a S3 bucket beforehands, which is not the purpose of IaC.
Would it be a possibility to see this feature in the future ?
Does anyone have a workaround for this
I've been using this with the Deployment Bucket plugin, so that I'm not dynamically creating the deployment bucket, but it's still managed with serverless. The only downside for this is after doing sls remove
, I have to manually (or have a CI script) empty and remove the deployment buicket.
I would appreciate if this plugin exposed some hooks for me to use, but ig i'll use the same plugin as well
It is not something I'm planning to support/fix very soon, honestly. It would need a big refactoring which I can't do currently. https://github.com/agutoli/serverless-layers/issues/116
I would appreciate if this plugin exposed some hooks for me to use, but ig i'll use the same plugin as well
What kind of hooks
do you need?
If the serverless-layers package can implement a lifecycle named deployLayer
then serverless will auto generate a hook for me called before:deployLayer
, then I can write a short plugin as a small js file which integrates in my serverless file, reads the layersDeploymentBucket name from custom and creates the bucket / ensures the bucket is created, before the serverless-layers plugin takes over. I would prefer this over integrating the plugin @tstackhouse mentioned because
- It is explicit control over execution flow,
- The small js file is very explicit about what it does and any developer that comes after me will be able to figure out why its necessary and they can safely remove it when serverless-layers plugin itself implements #116
I also created an issue for this here #132