Book Image

Building Serverless Applications with Python

Book Image

Building Serverless Applications with Python

Overview of this book

Serverless architectures allow you to build and run applications and services without having to manage the infrastructure. Many companies have adopted this architecture to save cost and improve scalability. This book will help you design serverless architectures for your applications with AWS and Python. The book is divided into three modules. The first module explains the fundamentals of serverless architecture and how AWS lambda functions work. In the next module, you will learn to build, release, and deploy your application to production. You will also learn to log and test your application. In the third module, we will take you through advanced topics such as building a serverless API for your application. You will also learn to troubleshoot and monitor your app and master AWS lambda programming concepts with API references. Moving on, you will also learn how to scale up serverless applications and handle distributed serverless systems in production. By the end of the book, you will be equipped with the knowledge required to build scalable and cost-efficient Python applications with a serverless framework.
Table of Contents (11 chapters)

Deploying with SAM

In this section, we will learn how to deploy the SAM applications. We have already learned what SAM applications and code look like, so we will learn how to deploy them via AWS CloudFormation:

  1. Firstly, let's set up our local environment for deployment purposes, and then start by installing awscli from pip:
  1. Next, you will need to configure your AWS environment using your credentials:
  1. You will need to enter the following details to make sure your AWS environment is successfully configured:
    • Your AWS Access Key
    • Your AWS Secret Key
    • The default region in which you want to operate
    • The default output format in which you want your data
  1. Now, let's try to deploy a simple Hello World Lambda application via SAM. We will have two code files for this. One is the Python file and the other is the template yaml file.
  1. We will use the default Hello World...