Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
AWS Lambda Quick Start Guide

You're reading from   AWS Lambda Quick Start Guide Learn how to build and deploy serverless applications on AWS

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781789340198
Length 184 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Markus Klems Markus Klems
Author Profile Icon Markus Klems
Markus Klems
Arrow right icon
View More author details
Toc

Building a Serverless backend with Python

In the previous section, we created a simple Lambda function using the serverless framework and Python. Now we will create a more complex service similar to the one that we created using Node.js, but using Python. In this section, we will refactor the Lambda function from our previous section. We will add DynamoDB for data persistence, create the other CRUD operations, and test our deployed service using Postman.

Go back to the Atom Editor where we last left off. Let's refactor the handler function a little bit. For example, we're going to replace the body with a short message, Created new article.

Let's print out the event that the Lambda function has been invoked with. Instead of naming the function handler hello, we simply rename it handler:

def handler(event, context):
print('received event{}'.format(event...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime