Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are layers actually supposed to work? #35

Open
jedfoster opened this issue Aug 30, 2020 · 2 comments
Open

Are layers actually supposed to work? #35

jedfoster opened this issue Aug 30, 2020 · 2 comments

Comments

@jedfoster
Copy link

I'm trying to add a layer to my lambda, but the following doesn't appear to have any effect:

  component: '@serverless/aws-lambda'
  inputs:
    code: ./
    handler: handler.info
    description: Info endpoint for ${name}
    region: us-west-2
    runtime: nodejs12.x
    layers:
      - arn:aws:lambda:us-west-2:XXXXXXXXX:layer:commoncode:1

The layer already exists, but it isn't being added to lambda.

@jedfoster
Copy link
Author

So, it looks like #15 was closed without being merged. I tried layer: arn:aws:lambda:us-west-2:XXXXXXXXX:layer:commoncode:1 and that at least spits out the layer info at the end of the sls command:

 info:
    name:        9eg2ee-...
    hash:        ...
    description: Info endpoint for service-abc
    memory:      512
    timeout:     10
    code:        ./
    bucket:      undefined
    shims:       (empty array)
    handler:     handler.info
    runtime:     nodejs12.x
    env:
      name: service-abc
    role:
      arn: arn:aws:iam:: XXXXXXXXX:role/9eg2ee-s0brcjs
    layer:       arn:aws:lambda:us-west-2: XXXXXXXXX:layer:commoncode:1
    arn:         arn:aws:lambda:us-west-2: XXXXXXXXX:function:9eg2ee-kswhuoz
    region:      us-west-2

But the layer is still not associated with the lambda in the AWS console.

@jedfoster
Copy link
Author

One final note for today: the good news—for me, at least—is that I can add a layer manually in the AWS console and subsequent serverless deploy commands have no adverse effects.

I'd still like to know if adding layers via serverless.yml is supposed to work; if so, what am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant