I am trying some skeleton deployment using python. Here is my serverless.yaml
My folder structure is
serverless-test
|_lambdas
|____handler.py
|_layers
|____common
|_________somefunction.py
service: serverless-test
frameworkVersion: '2'
provider:
name: aws
runtime: python3.8
lambdaHashingVersion: 20201221
stage: test
region: us-west-2
functions:
hello:
handler: lambdas/handler.hello
This works fine. Now as soon as I add a layer, I get the following error
No file matches include / exclude patterns
service: serverless-test
frameworkVersion: '2'
provider:
name: aws
runtime: python3.8
lambdaHashingVersion: 20201221
stage: test
region: us-west-2
functions:
hello:
handler: lambdas/handler.hello
layers:
- {Ref: CommonLambdaLayer}
layers:
common:
path: layers/common
name: common-module
description: common set of functions
I also tried adding include and exclude patterns. But it didn't solve my problem
service: serverless-test
frameworkVersion: '2'
provider:
name: aws
runtime: python3.8
lambdaHashingVersion: 20201221
stage: test
region: us-west-2
package:
individually: true
exclude:
- ./**
include:
- ./lambdas/**
functions:
hello:
handler: lambdas/handler.hello
layers:
- {Ref: CommonLambdaLayer}
layers:
common:
path: layers/common
name: common-module
description: common set of functions
package:
include:
- ./**
I also tried being very specific
service: serverless-test
frameworkVersion: '2'
provider:
name: aws
runtime: python3.8
lambdaHashingVersion: 20201221
stage: test
region: us-west-2
package:
individually: true
exclude:
- ./**
functions:
hello:
handler: lambdas/handler.hello
layers:
- {Ref: CommonLambdaLayer}
package:
exclude:
- ./**
include:
- ./lambdas/handler.py
layers:
common:
path: layers/common
name: common-module
description: common set of functions
package:
exclude:
- ./**
include:
- ./layers/common/somefunction.py
./**
to./*
. Now, it is working – Technique