Created
May 22, 2022 06:19
-
-
Save abhagsain/37d3f8a0cd7a93b05ab42da90177c070 to your computer and use it in GitHub Desktop.
How to use Lambda Layer With Serverless Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org: abhagsain | |
app: abhagsain-app | |
service: abhagsain-app | |
frameworkVersion: "3" | |
provider: | |
name: aws | |
runtime: python3.8 | |
httpApi: | |
cors: true | |
layers: | |
mylayers: | |
path: my-layers # This is the name of the folder in the current directory. | |
functions: | |
create_user: | |
memorySize: 512 | |
handler: handler.create_user | |
environment: ${file(env.json)} | |
layers: | |
# This should refer to the layer name in the layers section. It should be named as PascalCase (First letter of the word should be uppercase) and should end with 'LambdaLayer' | |
- { Ref: MylayersLambdaLayer } | |
- arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-spacy:42 # And you can refer to public layers as well. Max of 5 layers can be referred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment