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

While using this plugin it's no longer applying layers from `provider.layers` #88

Closed Shereef closed 2 years ago

Shereef commented 2 years ago

Consider this serverless.yml:

service: bla

plugins:
 - serverless-layers

provider:
     layers:
        - userLayerARN
layers:
    - userLayerConfig
functions:
   lambda1:
        handler: handler.layer1

userLayer will never be bound to the lambda1 function because this plugin adds the nodejs layer to function.layers which takes priority over provider functions.

the only solution I can think of is:

Obviously there is no hurry on this. this is none blocking because I can add my self created layers to the functions.

~If you point me in the right direction I can send you a PR for my suggested solution above~ ~I am trying to find if I have access to read+write from providers.layers in relateLayerWithFunctions but I can't find it~ Edit: found it PR incoming soon

agutoli commented 2 years ago

Beta Feature: 2.5.4-beta.0 https://github.com/agutoli/serverless-layers/pull/89