You could modify serverless.yml
- service
value to your favorite name.
Firstly, you need to install serverless framework.
$ npm install -g serverless
And you need to config aws credentials, please follow the aws document.
Install layer plugin
$ sls plugin install -n serverless-ruby-layer
And deploy to aws
$ sls deploy --stage production
# or specify aws profile
$ sls deploy --stage production --aws-profile custom-profile
After deployed, you will see some outputs, copy the layers arn to your lambda layers, or you could find the arn in you AWS Lambda Layers list.
In your lambda project, you could config the serverless.yml
use this layer like this
functions:
my_own_function:
handler: handler.call
layers:
- arn:aws:lambda:ap-northeast-1:xxxxxxx:layer:serverless-service-name-xxx:1
Deploy your lambda
$ serverless deploy
And test PG.library_version
Voila~