Book Image

Building Serverless Microservices in Python

By : Richard Takashi Freeman
Book Image

Building Serverless Microservices in Python

By: Richard Takashi Freeman

Overview of this book

Over the last few years, there has been a massive shift from monolithic architecture to microservices, thanks to their small and independent deployments that allow increased flexibility and agile delivery. Traditionally, virtual machines and containers were the principal mediums for deploying microservices, but they involved a lot of operational effort, configuration, and maintenance. More recently, serverless computing has gained popularity due to its built-in autoscaling abilities, reduced operational costs, and increased productivity. Building Serverless Microservices in Python begins by introducing you to serverless microservice structures. You will then learn how to create your first serverless data API and test your microservice. Moving on, you'll delve into data management and work with serverless patterns. Finally, the book introduces you to the importance of securing microservices. By the end of the book, you will have gained the skills you need to combine microservices with serverless computing, making their deployment much easier thanks to the cloud provider managing the servers and capacity planning.
Table of Contents (13 chapters)
Title Page
Dedication

Creating a profile, an S3 bucket, IAM policies, and IAM roles resources

We will first set up an S3 bucket that will hold the source code for the Lambda deployment package. IAM policies and roles allow API Gateway to invoke Lambda, and Lambda to access DynamoDB. We set them up using the AWS Management Console; here, we will use the AWS CLI and SAM.

The code, shell scripts, and configuration files used in this chapter are available under the ./serverless-microservice-data-api/ folder.

Creating an AWS credentials profile

Follow these steps to create an AWS credentials profile:

  1. Create an AWS profile called demo:

$ aws configure --profile demo
  1. Re-enter the same AWS aws_access_key_id and aws_secret_access_key details as in Chapter...