Book Image

Building Serverless Python Web Services with Zappa

By : Abdulwahid Abdulhaque Barguzar
Book Image

Building Serverless Python Web Services with Zappa

By: Abdulwahid Abdulhaque Barguzar

Overview of this book

Serverless applications are becoming very popular these days, not just because they save developers the trouble of managing the servers, but also because they provide several other benefits such as cutting heavy costs and improving the overall performance of the application. This book will help you build serverless applications in a quick and efficient way. We begin with an introduction to AWS and the API gateway, the environment for serverless development, and Zappa. We then look at building, testing, and deploying apps in AWS with three different frameworks--Flask, Django, and Pyramid. Setting up a custom domain along with SSL certificates and configuring them with Zappa is also covered. A few advanced Zappa settings are also covered along with securing Zappa with AWS VPC. By the end of the book you will have mastered using three frameworks to build robust and cost-efficient serverless apps in Python.
Table of Contents (20 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Installing and configuring Zappa


Installing Zappa is a straightforward task, but before we move ahead, we need to configure the prerequisites. Make sure you have Python 2.7 or Python 3.6 and have a valid AWS account. Now, you need to configure the AWS credentials on your machine with help awscli:

$ pip install awscli

Configure the AWS credentials using the aws configure command, as shown in the following screenshot:

The configuration for AWS credentials requires that you have an AWS Access Key ID, AWS Secret Access Key, Default region name, and a Default output format.

You can get AWS credential information from your My Security Credentials page, as shown in the following screenshot:

Once you've configured your AWS credentials, we can move ahead with Zappa's installation.

Zappa must be installed in a virtual environment. It's strongly recommended that you create a virtual environment and activate it before installing Zappa. I prefer to use the virtualenv tool. There are other tools available to...