Noman Maqsood
Noman Maqsood

Reputation: 499

Serverless: Layers No file matches include / exclude patterns

My serverless.yml file works fine as soon as I add layers I starting getting this error

Serverless Error ----------------------------------------

No file matches include / exclude patterns
service: foundation

useDotenv: true

custom:
  name: foundation

provider:
  name: aws
  stackName: ${self:service}-${self:provider.stage}
  region: us-east-1
  stage: ${opt:stage, 'dev'}
  environment:
    REGION: ${self:provider.region}
    STAGE: ${self:provider.stage}

layers:
  certificates:
    path: certificate 

plugins:
  - serverless-deployment-bucket
  - serverless-pseudo-parameters
  - serverless-plugin-typescript

functions:
  - ${file(./src/handler/function.yml)}

resources:
  - ${file(./resources/outputs.yml)}

runtime: Node.js

Note: using layers to add certificates to lambda

Serverless version: 2.31.0

Upvotes: 0

Views: 2811

Answers (1)

gizemsever
gizemsever

Reputation: 378

You may be getting this error if you execlude the directory where the layer is running through the plugins you use or in another part of the yml file. Maybe editing it this way will solve the problem

this link has an explanation about it

layers:
  certificates:
    package:
      include:
        - ./your/layer/path/**

Upvotes: 2

Related Questions