A simple Hello, World! with Serverless

Erik Storrs
Sep 3, 2018 · 2 min read

Setting up our environment

$ mkdir serverless-hello-world
$ cd serverless-hello-world
$ python3.6 -m venv .
$ source bin/activate
$ export AWS_ACCESS_KEY_ID=<your-key-here>
$ export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>

The serverless.yml config file

Defining our functions in handler.py


$ sls deploy

Making sure it works

$ sls invoke -f hello-world
"statusCode": 200,
"body": "{\"message\": \"Hello, World!\", \"input\": {}}"
Erik Storrs

Written by

Data Scientist/Engineer | Enjoys wearing a lot of different hats 🧢

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade