Building Serverless Microservices in Python: A Complete Guide to Building, Testing, and Deploying Microservices Using Serverless Computing on AWS

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

A practical guide for developing end-to-end serverless microservices in Python for developers, DevOps, and architects. Key Features Create a secure, cost-effective, and scalable serverless data API Use identity management and authentication for a user-specific and secure web application Go beyond traditional web hosting to explore the full range of cloud hosting options Book Description 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. What you will learn Discover what microservices offer above and beyond other architectures Create a serverless application with AWS Gain secure access to data and resources Run tests on your configuration and code Create a highly available serverless microservice data API Build, deploy, and run your serverless configuration and code Who this book is for If you are a developer with basic knowledge of Python and want to learn how to build, test, deploy, and secure microservices, then this book is for you. No prior knowledge of building microservices is required.

Author(s): Takashi Freeman Richard
Year: 2019

Language: English
Pages: 168

Title Page
Copyright and Credits
Building Serverless Microservices in Python
About Packt
Why subscribe?
Packt.com
Contributors
About the author
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Serverless Microservices Architectures and Patterns
Understanding different architecture types and patterns
The monolithic multi-tier architecture and the monolithic service-oriented architecture
Benefits of monolithic architectures
Drawbacks of the monolithic architectures
Overview of microservices
Benefits and drawbacks of microservice architectures
SOA versus microservices
Virtual machines, containers, and serverless computing
Virtual machines
Containers
Serverless computing
Comparing virtual machines, containers, and serverless
Overview of microservice integration patterns
Design patterns
Why are patterns useful?
Software design patterns and principles
Serverless microservices pattern categories
Communication styles and decomposition microservice patterns
Communication styles
One-to-one communication microservice patterns
Many-to-many communication microservice patterns
Decomposition pattern by business capability
Decomposition pattern by bounded context
Serverless computing in AWS
Overview of some of the key serverless services in AWS
AWS Lambda
Serverless computing to implement microservice patterns
Example use case – serverless file transformer
Setting up your serverless environment
Setting up your AWS account
Setting up MFA
Setting up a new user with keys
Managing your infrastructure with code
Installing bash on Windows 10
Updating Ubuntu, installing Git and Python 3
Installing and setting up the AWS CLI
Summary
Creating Your First Serverless Data API
Overview of security in AWS
Why is security important?
Security by design principles
AWS Identity and Access Management
JavaScript object notation
IAM policies
IAM users
IAM groups
IAM roles
Securing your serverless microservices
Lambda security
API Gateway security
DynamoDB security
Monitoring and alerting
Find out more
Building a serverless microservice data API
Serverless microservice data API requirements
Query string
Data API architecture
Setting up Lambda security in the AWS Management Console
Creating an IAM policy
DynamoDB IAM policy
Lambda IAM policy
Creating the Lambda IAM role
Creating and writing to a NoSQL database called DynamoDB using AWS
Creating a DynamoDB in AWS
Writing data to DynamoDB using AWS
Querying DynamoDB using AWS
DynamoDB Scan in AWS Management Console
DynamoDB Query in AWS Management Console
Deleting DynamoDB using AWS
Creating and writing to a NoSQL database called DynamoDB using Python
Creating a DynamoDB table using Python
Writing to DynamoDB using Python
Querying DynamoDB using Python
Creating a Lambda to query DynamoDB
Creating the Lambda function
Testing the Lambda function
Setting up the API Gateway and integrating it with a Lambda proxy
Connecting API Gateway, Lambda, and DynamoDB
Cleaning-up
Summary
Deploying Your Serverless Stack
An overview of serverless stack build and deploy options
Manually provisioning infrastructure
Infrastructure as code
Building and deploying using the Serverless Application Model (SAM)
Building and deploying using alternate options
Creating a profile, an S3 bucket, IAM policies, and IAM roles resources
Creating an AWS credentials profile
Creating an S3 bucket
Setting up the configuration files for your AWS account
Updating the polices and assuming roles files
Creating the IAM roles and policies
Checking the IAM roles and policies
Building and deploying with API Gateway, Lambda, and DynamoDB
Building the Lambda as a ZIP package
SAM YAML template
Packaging and deploying your serverless stack
Putting it all together
Manually testing the serverless microservice
Making code and configuration changes
Deleting the serverless stack
Summary
Testing Your Serverless Microservice
Unit testing your Python Lambda code
Why is testing important?
Types of testing
Unit testing Lambda Python code
The sample test data
The unit test
Mocking
Running the unit test
Code coverage
Running and debugging your AWS Lambda code locally
Batch-loading data into DynamoDB
Running the Lambda locally
Integration testing using real test data
Testing that a Lambda has been deployed correctly
Testing that API Gateway has been deployed correctly
The AWS Serverless Application Model CLI
Loading and end-to-end testing at scale
Load testing your serverless microservice
Strategies to reduce the API's latency
Cleaning up
Summary
Securing Your Microservice
Overview of the security in AWS
Why is security important?
Types of security terms in AWS
Overview of AWS Identity and Access Management (IAM)
IAM users
IAM groups
IAM roles
Securing your serverless microservice
Lambda security
DynamoDB security
Monitoring and alerting
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think