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)

S3 trigger

S3 is the AWS object storage service, where the user can store and retrieve any type of object. In this section, we shall be learning how the S3 trigger works, what the event structure of an S3 event looks like, and also how to make use of them in the learning to build a Lambda function.

We will be building a Lambda function that does the following:

  1. Receives a PUT request event from the S3 service
  2. Prints the name of the file and other major details
  3. Transfers that file to a different bucket

So, let's get started on learning how to use the S3 trigger efficiently. We will be working on this task step-by-step, as follows:

  1. Firstly, we need to create two S3 buckets for the task. One will be the bucket where the file will be uploaded by the user. The other will be the one where the file is transferred and uploaded by the Lambda function.
  2. The S3 console looks like the...