serverless-layers icon indicating copy to clipboard operation
serverless-layers copied to clipboard

Unable to attach layers to the existing lambda

Open VaddeRam opened this issue 3 years ago • 2 comments

I'm trying to attach common layers to the 5 lambda functions

image

Have defined one sample function in the code,

service: user-rep description: user-rep-tool frameworkVersion: ^3.0.0 useDotenv: true

plugins:

  • serverless-dotenv-plugin
  • serverless-offline
  • serverless-layers

package: individually: true

serverless-layers: layersDeploymentBucket: ${self:service}-tool-${self:provider.stage}-layers functions: # optional - query-access-requests - dispose-access-request - create-access-request - query-affiliates - lambda-authorizer - pre-token-trigger dependenciesPath: ./package.json

provider: name: aws region: ${opt:region, 'us-east-1'} runtime: nodejs14.x

functions: query-affiliates: handler: src/lambda/query-affiliates/index.handler architecture: arm64

VaddeRam avatar Mar 06 '22 18:03 VaddeRam

I had the same issue when upgrading from 2.5.2 to 2.5.4. Additionally, it removed layers that were already added to lambdas. Downgrade to 2.5.2 fixed it for me.

MHekert avatar Apr 20 '22 09:04 MHekert

I had similar issue with 2.5.4. Downgrade to 2.5.3 solved it

ivanmartos avatar Apr 21 '22 07:04 ivanmartos

Bugfix (not release yet) https://github.com/agutoli/serverless-layers/pull/128

agutoli avatar Dec 23 '22 06:12 agutoli