Skip to content

Are layers actually supposed to work? #35

Open

Description

@jedfoster

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.

Activity

  1. jedfoster commented on Aug 30, 2020

    @jedfoster
    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.

  2. jedfoster commented on Aug 30, 2020

    @jedfoster
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions