Skip to content

Latest commit

 

History

History
34 lines (18 loc) · 1.83 KB

serverless.md

File metadata and controls

34 lines (18 loc) · 1.83 KB

Important Serverless commands

Every serverless command starts with serverless or shorter sls

Serverless python hello world (source: https://serverless.com/framework/docs/providers/aws/examples/hello-world/python/):

screen shot 2018-02-11 at 10 59 50

screen shot 2018-02-11 at 10 59 40

The basic deploy command: sls deploy

It produces the following output for our stack (of course API Gateway endpoints are different for everybody)

screen shot 2018-02-11 at 10 22 38

It's possible to limit commands to a single lambda function e.g. when we want to redeploy just a single function or check it's logs.

sls deploy -f {function_name}

screen shot 2018-02-11 at 10 25 50

sls logs -f {function_name}

screen shot 2018-02-11 at 10 27 07

In order to get the information about our service we can use sls info

screen shot 2018-02-11 at 10 26 01

When we want to clean up and remove the service from AWS we can run sls remove. This should remove all the resources created in the AWS, leaving only the ones having DeletionPolicy: Retain specified. In our case S3 buckets.