Piotr Grzesik
Installation
Project initialization
Deployment
Function invocation
npm install -g serverless
serverless create --template aws-python3 --path hello-lambda
serverless deploy function -f hello
serverless invoke -f hello
Cleanup
serverless remove
service: example
provider:
name: aws
runtime: python3.6
region: us-east-1
iamRoleStatements:
- Effect: "Allow"
Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Resource:
- "arn:aws:logs:*:*:*"
environment:
STAGE: ${self:custom.stage}
functions:
example:
handler: handler.example
events:
- schedule: rate(1 day)
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: 'non-linux'
stage: ${opt:stage, self:provider.stage}
@p_grzesik
pj.grzesik@gmail.com
piotrgrzesik.pl