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)

Lambda's logs in CloudWatch

So far, we have learned about and understood the metrics of AWS Lambda in great detail. Now, we will move on to understanding the logs of the Lambda functions. As always, we will try to understand them via the following steps:

  1. Logs for AWS Lambda functions are stored in CloudWatch's Logs service. You can access the CloudWatch Logs service by going to the Logs dashboard by clicking on the main CloudWatch dashboard.
  1. When you click on the logs of the serverless-api, /aws/lambda/serverless-api, in the list, we go to the log stream of the serverless API, which looks like this:
  1. Each log stream here is a Lambda invocation. So, whenever your Lambda function is invoked, it creates a new log stream here. If the invocation is a part of Lambda's retry process, then the logs for that particular invocation will be written under the most recent...