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

Setting up the API Gateway and integrating it with a Lambda proxy

Now that we know the Lambda function works with some API Gateway test data, and returns a header and body with a statusCode of 200, we just need to add the API Gateway that will invoke the Lambda function, as shown in the following diagram:

Perform the following steps:

  1. Sign in to the AWS Management Console and open the API Gateway console at https://console.aws.amazon.com/apigateway/.
  2. Choose Get Started or, in the Amazon API Gateway navigation pane, choose APIs and choose Create API.
  3. On the Create page, perform the following steps:
    1. In Choose Protocol, select REST
    2. In Create new API, select New API
    3. Under Settings, type metrics for API name
    4. Choose Regional for Endpoint Type
    5. Choose Create API
  4. Choose Create Resource from the Actions drop-down menu.
  5. In the New Child Resource window, perform the following steps...