Lambda-layers for Bagubagu projects.
Latest version is 11. To use latest, add following to your sam template
.
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
MyLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./functions
Handler: index.handler
Runtime: nodejs12.x
Timeout: 30
MemorySize: 512
Layers:
- "arn:aws:lambda:us-east-1:116952590464:layer:bagubagu-common:11"
To use a specific version
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
MyLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: my-lambda
CodeUri: ./functions
Handler: index.handler
Runtime: nodejs12.x
Timeout: 30
MemorySize: 512
Layers:
- !Sub arn:aws:lambda:us-east-1:116952590464:layer:bagubagu-common:${LayerVersion}
Add useful-library
npm module to bagubagu-common lambda-layer, then publish.
cd bagubagu-common/nodejs
yarn --production
yarn add useful-library
cd ../..
./scripts/publish-bagubagu-common.sh