Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Building Serverless Python Web Services with Zappa
Building Serverless Python Web Services with Zappa

Building Serverless Python Web Services with Zappa: Build and deploy serverless applications on AWS using Zappa

eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Building Serverless Python Web Services with Zappa

Amazon Web Services for Serverless

In this chapter, we are going to learn about Amazon Web Services for managing a serverless infrastructure. We will be exploring the AWS workflow to create a serverless application. We will learn about the manual process for creating a basic serverless application and an automated process using the AWS CLI (command line interface).

Topics we will cover in this chapter include:

  • Transitioning from the traditional server to serverless
  • Getting started with AWS Lambda
  • How AWS Lambda works
  • Executing a Lambda function
  • Creating Lambda triggers
  • Creating a serverless RESTful API
  • AWS Lambda interaction by the AWS CLI 

Technical requirements

There are some technical prerequisites before moving ahead. We are going to demonstrate AWS through a web console and the AWS CLI. The following prerequisites should be considered:

  • All the demonstration has been tested on a Linux machine with Ubuntu 16.04. We have shared the links to each library used in this book. You can get the detailed information about the installation and configuration with a specific platform.
  • We are using open source libraries and software. Hence, for each library, we are going to share its official documentation links. You can refer to those links for detailed information about a specific library.

Transitioning from traditional server to serverless

Web hosting has changed drastically since it started. Physical server machines were shared among many web applications, and it was a really big challenge when it came to scale. It proved to be very expensive for any individual or company to afford an entire server machine to host their web application.

But, thanks to virtualization, the need for a physical server for any web application has been eliminated. Virtualization provides the ability to create many virtual servers as opposed to a single physical server.

Now, the new era of serverless is making the developer's life easier, as we can focus our hard work on development instead of investing time and money on deployment.

Amazon introduced Amazon Elastic Compute Cloud (Amazon EC2) as a cloud computing solution. Amazon EC2 makes it possible to create an array of virtual servers or instances the Amazon Cloud without investing in hardware. You can scale it as per your requirements in terms of networking, computing, and storage.

The serverless approach is nothing but the process of eliminating the manual workload of setting up the hosting environment. Cloud service providers provide serverless services, and so you never actually own any server. Instead, the cloud service provider executes your code in a high-availability infrastructure.

Getting started with AWS Lambda

Many cloud service providers introduced different services for the serverless infrastructure. Amazon introduced AWS Lambda as a compute service, where you just provide your code and AWS Lambda executes the code in a highly scalable infrastructure by itself. You don't need to worry about managing the services manually. You need to pay for the compute time of your code execution, and there are no charges when your code is not running.

AWS Lambda executes the code as needed in response to events such as data storage events on an S3 bucket, Amazon DynamoDB events, and HTTP request events via the API Gateway. AWS Lambda is able to execute the code based on scheduled time events via AWS CloudWatch Events. AWS Lambda supports Python, Node.js, C#, and Java.

Amazon Simple Storage Service (S3) is a storage service provided by Amazon. It has a simple web interface to store the data. Amazon S3 has associated services events that can be used by other services.

How AWS Lambda works

You need to write a function, which will be executed by AWS Lambda on your behalf.

AWS Lambda is implemented on a container-based model that supports a runtime environment and executes the code as per the Lambda function configuration. When the Lambda function is invoked, it launches the container (an execution environment) based on the AWS Lambda configuration and enables the basic runtime environment, which is required to execute the code.

Let's start with some practical work:

  1. To create a Lambda function, you must have an AWS account. If you don't have an AWS account, then you need to sign up on AWS (https://aws.amazon.com/) by providing some basic contact and payment information, as it's essential information required by Amazon.
  2. Go to the Lambda home page (https://console.aws.amazon.com/lambda/home). Click on the Create a function button. This will redirect you to the Create function page, which is described in the next step. Take a look at the following screenshot:
  1. AWS provides three different options to create a Lambda function, such as Author from scratch, Blueprints, and Serverless Application Repository. We will be using the Blueprint option, which has some built-in Lambda functions. We can choose these blueprints based on our requirements from the search bar, where you can filter by tag and attributes or search by keywords:
  1. Let's choose a hello-world-python blueprint. Once we choose the blueprint, we need to set up the basic information about the Lambda function. This information includes the Lambda function's Name and Role, as shown in the following screenshot:
  1. Here, Name will be a unique identification for your Lambda function and Role defines the permissions of your Lambda function.

There are three options available for creating a role:

  • Choose an existing role
  • Create new role from template(s)
  • Create a custom role
    Let's look at them in more detail:
    • Choose an existing role: This allows you to select the previously created role.
    • Create new role from template(s): Here, you need to define a role name. AWS Lambda provides ready-made built-in role policy templates that have pre-configured permissions. These are based on other AWS services-related permissions required by the AWS Lambda function. On any role selection, Lambda will automatically add the logging permission to CloudWatch (AWS logging service), as this is the basic permission required by Lambda.
    • Create a custom role: AWS provides an additional privilege to create a customized role to access AWS Lambda. Here, you can define the role based on your requirement.
  1. Let's create the HelloWorld Lambda function with some role. Here, I chose the S3 object read-only permission policy template.
  1. The following screenshot describes the newly created HelloWorld Lambda function:
HelloWorld Lambda function

The Lambda function includes three sections:

  • Configuration
  • Triggers
  • Monitoring

Let's look at detailed information about the configuration and monitoring. We will have a separate section for triggers. 

Configuration

Lambda execution depends on the configuration setting. Configuring the Lambda function requires the following details:

  • Function code
  • Environment variables
  • Tags
  • Execution role
  • Basic settings
  • Network
  • Debugging and error handling

Function code

Here, you are required to write the code. The Lambda function has a predefined pattern for writing the code. While writing the code, you need to understand the context. Lambda provides three kinds of feasibility, which decides your runtime execution for the code:

  • Code entry type: This section provides three options to decide the entry type for your code, such as editing code inline, uploading a ZIP file, and uploading a file from Amazon S3.
  • Runtime: This section provides options to decide the runtime programming language context for your code, such as Python, C#, NodeJS, and Java.
  • Handler: A handler defines the path to your method/function, such as <filename>.<method_name>. For example, if you want to execute a function named as a handler, which is defined in main.py, then it would be main.handler.

Let's get back to our newly created hello world function named lambda_handler.

Here, the handler value is defined as lambda_function.lambda_handler, where lambda_function.py is the filename and lambda_handler is the method name:

def lambda_handler(event, context): 
    print("value1 = " + event['key1']) 
    print("value2 = " + event['key2']) 

Lambda_handler accepts two positional arguments, event and context:

  • event: This argument contains event-related information. For example, if we configure the Lambda function with Amazon S3 bucket events, then we would get S3 bucket information in event arguments, such as bucket name, region, and so on.
  • context: This argument contains the context-related information that may be required during runtime for code execution.

Environment variables

You can set the environment variables in key-value pairs, which can be utilized in your code.

Tags

You can use tags for grouping and filtering your Lambda functions. You may have multiple Lambda functions with different regions, so tags help make Lambda functions more manageable.

Execution role

As we previously discussed the role and permission while creating the Lambda function, Lambda provides the capability to edit the existing role that you chose at the time of the Lambda function creation.

Basic settings

Under basic settings, you can configure the memory and execution timeout. Lambda supports memory from 128 MB to 1,536 MB. Timeout execution is in seconds; the default timeout execution Lambda supports is 300 seconds. This setting helps you to control the code execution performance and cost for your Lambda function.

Network

In the network section, you can configure the network access to your Lambda function.

AWS provides a VPC (Virtual Private Cloud) service to create a virtual network, which allows access to AWS services. You can also configure the networking as per your requirements.

We will discuss the Lambda function with VPC in the upcoming chapters. As of now, we will choose No VPC in the network section.

Debugging and error handling

AWS Lambda automatically retries the failed asynchronous invocation. But you can also configure the DLQ (Dead Letter Queue), such as the SQS queue or SNS topic. To configure the DLQ, the Lambda function must have permission to access DLQ resources.

Now that we understand the configuration, let's go ahead with the execution of the Lambda function.

Let's look at the Monitoring section, which describes the activity related to our Lambda function. It can be used to analyze the performance of our Lambda function execution.

Monitoring

AWS CloudWatch is a monitoring service for AWS resources and manages all activity logs. It creates metric data to generate statistical data. CloudWatch enables real-time monitoring of AWS resources. It also monitors hardware information related to AWS EC2 or RDS database instances and other resources.

Lambda monitoring sections display the last 24 hours' analytics data related to the Lambda function's activity and performance. The following screenshot shows the monitored analytics information about our hello world Lambda function:

Let's move on to the next section, where we are going to look at the Lambda function execution.

Executing the Lambda function

AWS Lambda supports several methods of execution. Let's start with the basic execution from its own web console interface. AWS Lambda provides the capability to test the function manually, where you can define the test event context. If you want to test against some other Amazon services, then there are built-in event templates available.

The following screenshot demonstrates the test event creation:

As shown in the preceding screenshot, a single Lambda function can have a maximum of 10 test events and the test events are persisted, so you can reuse them whenever you want to test your Lambda function.

I created the test event with the event name as HelloWorld and now I am going to execute the HelloWorld function, when converting the Lambda function as a Python microservice, as shown in the following code:

from __future__ import print_function 
import json 
 
print('Loading function') 
 
def lambda_handler(event, context): 
    print("Received event: " + json.dumps(event, indent=2)) 
    print("value1 = " + event['key1']) 
    print("value2 = " + event['key2']) 
    print("value3 = " + event['key3']) 
    return "Hello World" 

Here, we are printing the event data and then returning back to the Hello World string:

Lambda manages some information on every request execution, such as a request ID and billing information. The Lambda price model is based on the time consumption on request processing, whereas the request ID is the unique identification of every request.

In the Log output, you can see all the print statements output. Now, let's raise an error and see how Lambda responds and returns the logs.

We are going to replace the current code with the following snippet:

from __future__ import print_function 
import json 
 
print('Loading function') 
 
 
def lambda_handler(event, context): 
    print("Received event: " + json.dumps(event, indent=2)) 
    raise Exception('Exception raised manually.') 

The following screenshot is the log snippet of the execution result:

Here, Lambda responded with the complete stack trace information and logged it as well. You can check the CloudWatch logs, as CloudWatch is preconfigured with the AWS Lambda execution.

We learned about the Lambda function execution from the Lambda console, and now it's time to execute the Lambda function from a schedule trigger. In our project, we often need to have a cron job schedule to execute some functionality at a particular time period.

Lambda triggers will help us to set up the triggers based on events. Let's move ahead to introduce the trigger to our hello world function.

Creating Lambda triggers

The Lambda function can be configured in response to events. AWS provides a list of triggers that support lots of events. These triggers belong to their associated AWS services.

You can add a trigger to your Lambda function from the triggers section.

I am going to slightly modify the hello world Lambda function. Here, we are printing the request ID, which is received in the context object as an aws_request_id attribute. It also prints the timestamp:

Now, we are going to add a trigger to our Lambda function that will execute our Lambda function every minute.

The following screenshot shows the Add trigger flow, where you can easily configure any trigger from the left-hand panel with your Lambda function:

We are going to configure the CloudWatch Events trigger. CloudWatch Events deliver near real-time system events that describe the changes in AWS resources.

You can set up simple event rules with operational events in AWS resources as they occur, and you can also schedule automated events that self-trigger based on cron or the rate expression.

The cron and rate expression are two different methods to define a schedule expression. The cron expressions have six required fields, such as cron (fields), and the rate expressions have two required fields, such as rate (value unit). These methods help us to define a schedule expression. You can find detailed information at http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html.

Here, we are going to schedule a rate expression to execute our hello world Lambda function every minute. We need to select CloudWatch Events from the triggers dropdown.

To create the CloudWatch event rule, we are going to create a new rule. We need to set up the rule with some required information, such as the rule name, which is a unique identifier. So, we are going to name the rule as hello-world-every-minute and the rule type as either the event pattern or schedule expression. In our case, it would be a schedule expression as the rate (1 minute), as shown in the preceding screenshot.

Once we set the trigger and enable it, the scheduled event would get triggered as per the schedule expression. Let's see our hello world Lambda logs after five minutes.

To view the logs related to any services, you need to do the following:

  1.  Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/
  2. In the navigation pane, choose Logs
  3. Select the log group related to the HelloWorld Lambda function

The following screenshot describes the CloudWatch log access:

By selecting the HelloWorld Lambda function log groups, you see the logging activity related to our HelloWorld Lambda function. The following screenshot shows the logs of the HelloWorld function:

Here, you can see that our hello world Lambda function is executed exactly every minute since the time we have enabled the trigger.  

Now, let's move ahead to create a serverless RESTful API.

Serverless RESTful API

Let's understand the microservice scenario where we are going to deploy a serverless hello world function that will respond to HTTP events through the API Gateway.

The Amazon API Gateway service enables you to create, manage, and publish a RESTful API to interact with AWS resources at any scale. The API Gateway provides an interface where you expose the backend through the REST application programming interface.

To enable the AWS serverless infrastructure, the API Gateway plays an important role, as it can be configured to execute the Lambda functions. 

Now, we are going to configure an API Gateway service to executes the Lambda function

Here is the hello world function:

When we integrate the AWS Lambda function with the API Gateway, the Lambda function must return a dictionary object with the required keys as statusCode, headers, and body.  The value of the body attribute must be in a JSON string. Hence, we converted the Python dictionary into a JSON string.

It's time to integrate the API Gateway with the Lambda function. As we have seen in our previous discussion about triggers, we are going to add a trigger with the API Gateway:

We are going to create an API Gateway service with the name as LambdaMicroservice. The API Gateway enables you to create and maintain a deployment stage as per your requirement.

If you want to secure your API then you have two options—using AWS IAM and opening it with the access key, or keeping it as open, making it publicly available.

AWS IAM (Identity Access Management) is an AWS cloud service that is helpful in creating a secure access credential in order to access AWS cloud services.

Opening with the access key feature allows you to generate the key from the API Gateway console. In our case, we are going to keep the security open only, as we need to access our API publicly:

Once you add and save the changes, the REST API is ready within a few seconds. The invoke URL is our REST API endpoint.

Let's hit the invoke URL using the curl command-line tool and see what happens:

$ curl https://cfi6872cxa.execute-api.us-east-2.amazonaws.com/prod/HelloWorld
{"message": "Hello World returned in JSON"}

That's it. We are done with creating a serverless RESTful API using AWS Lambda and the API Gateway. Now, we are going to see how we can interact with the AWS services using the AWS CLI.

AWS Lambda interaction with theAWS CLI 

The AWS CLI is an open source tool developed on top of AWS SDK for Python using the Boto library, which provides commands to interact with AWS services. With the very minimum configuration, you can manage any AWS services from the CLI. It provides direct access to AWS services and you can develop shell scripts to manage your resources.

For example, if you want to upload the file to the S3 bucket, then you can do so by just a single command from the CLI:

$ aws s3 cp index.html s3://bucket-name/ 

aws s3 cp is a shell-like command that performs the multi-part file upload operation in order to complete the operation.

It also supports customization for some of the AWS services. You can see the list of AWS services supported by aws-cli by using the --help command.

Installing the AWS CLI

awscli is available to as a Python distributor package. You can easily install it with the pip command, as described in the following code:

$ pip install awscli --upgrade  

Here are the prerequisites:

  • Python 2 with version 2.6.5+ or Python 3 with version 3.3+
  • Unix, Linux, macOS, or Windows

Configuring the AWS CLI

awscli directly accesses AWS services but we need to configure and authenticate it in order to access AWS services.

Run the aws configure command to configure the AWS CLI with your Amazon account:

You can get the AWS access key ID and AWS secret access key from the My Security Credentials option, as shown in the following screenshot:

Let's configure the AWS Lambda function using AWS CLI.

Configuring Lambda function with the AWS CLI

Let's configure our hello world Lambda function and triggers using the awscli utility command.

The AWS CLI supports all available AWS services. You can see a detailed description of the aws command using aws help and it will also list all the available services.

We are interested in Lambda, as we are going to create a Lambda function with a simple hello world context:

$ aws lambda help  

This will list a complete description of the Lambda service and all the available commands that are required to manage the AWS Lambda service.

Creating a Lambda function

Here, we are going to create a new Lambda function with the aws lambda create-function command. To run this command, we need to pass the required and optional arguments.

Make sure you have a role with permission for the lambda:CreateFunction action.

Previously, in the AWS Lambda console, we chose the code entry point as inline editing. Now, we will be using a ZIP file as a deployment package.

Before creating the Lambda function, we should create a Lambda function deployment package.

This deployment package will be a ZIP file consisting of your code and any dependencies.

If your project has some dependencies, then you must install the dependencies in the root directive of the project. For example:

   $ pip install requests -t <project-dir> OR  
   $ pip install -r requirements.txt  -t <project-dir> 

Here, the -t option indicates the target directory.

Create a simple lambda_handler function in a file named as handler.py, as shown in the following screenshot:

Now, let's make a deployment package as a ZIP file consisting of the preceding code:

Now, we are ready to create the Lambda function. The following screenshot describes the command execution:

You can see that, in the AWS Lambda console, the Lambda function immediately got created:

Let's discuss the required and optional parameters that we used with the aws lambda create-function command:

  • --function-name (required): The name is self-explanatory. We need to pass the Lambda function name that we are intending to create.
  • --role (required): This is a required parameter where we need to use the AWS role ARN as a value. Make sure this role has permissions to create the Lambda function.
  • --runtime (required): We need to mention the runtime environment for the Lambda function execution. As we mentioned earlier, AWS Lambda supports Python, Node.js, C#, and Java. So these are the possible values:
    • python2.7
    • python3.6
    • nodejs
    • nodejs4.3
    • nodejs6.10
    • nodejs4.3-edge
    • dotnetcore1.0
    • java8
  • --handler (required): Here, we mention the function path that will be an execution entry point by the AWS Lambda. In our case, we used handler.lambda_function, where the handler is the file that contains the lambda_function.
  • --description: This option lets you add some text description about your Lambda function.
  • --zip-file: This option is used to upload the deployment package file of your code from your local environment/machine. Here, you need to add fileb:// as a prefix to your ZIP file path.
  • --code: This option helps you upload the deployment package file from the AWS S3 bucket.

You should pass a string value with a pattern, such as the one shown here:

 "S3Bucket=<bucket-name>,S3Key=<file-name>,S3ObjectVersion=<file-version-id>". 

There are many other optional parameters available that you can see with the help command, such as aws lambda create-function help. You can use them as per your requirement.

Now we will see the Lambda function invocation using the command $ aws lambda invoke.

Invoking the function

The Lambda CLI provides a command to directly invoke the Lambda function:

$ aws lambda invoke --function-name <value> <outfile> 

Let's look at the parameters:

  • --function-name (required): This parameter asks for a Lambda function name
  • outfile (required): Here, you need to mention a filename where the returned output or response by the Lambda function will be stored

Here are other optional parameters available that you can list by the help command.

Let's invoke our recently created HelloWorldCLI function:

When we invoked the Lambda function, it immediately responded with a status code and the Lambda function returned the output data stored in the newly created lambda_output.txt file by the lambda invoke command.

Create-event-source-mapping

This is a subcommand of the aws lambda command and is used to create event mapping for your Lambda function.  $ aws lambda create-event-source-mapping supports only Amazon Kinesis stream and Amazon DynamoDB stream events mapping. We will discuss event mapping with the Amazon API Gateway and CloudWatch event using Zappa in the upcoming chapters.

Summary

In this chapter, we learned about the manual process of creating a simple AWS Lambda and configuring some triggers against it. Also, we looked at the AWS Lambda configuration using the AWS CLI. It's really amazing to implement a serverless application. These AWS services play an essential part in creating a serverless infrastructure, where you can develop your application and deploy it as serverless.

Questions

  1. What would be the benefits of being serverless?
  2. What is the role of Amazon S3 in the serverless infrastructure?
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Scalable serverless Python web services using Django, Flask, and Pyramid.
  • • Learn Asynchronous task execution on AWS Lambda and scheduling using Zappa.
  • • Implementing Zappa in a Docker container.

Description

Serverless applications are becoming very popular these days, not just because they save developers the trouble of managing the servers, but also because they provide several other benefits such as cutting heavy costs and improving the overall performance of the application. This book will help you build serverless applications in a quick and efficient way. We begin with an introduction to AWS and the API gateway, the environment for serverless development, and Zappa. We then look at building, testing, and deploying apps in AWS with three different frameworks--Flask, Django, and Pyramid. Setting up a custom domain along with SSL certificates and configuring them with Zappa is also covered. A few advanced Zappa settings are also covered along with securing Zappa with AWS VPC. By the end of the book you will have mastered using three frameworks to build robust and cost-efficient serverless apps in Python.

Who is this book for?

Python Developers who are interested in learning how to develop fast and highly scalable serverless applications in Python, will find this book useful

What you will learn

  • Build, test, and deploy a simple web service using AWS CLI
  • Integrate Flask-based Python applications, via AWS CLI configuration
  • Design Rest APIs integrated with Zappa for Flask and Django
  • Create a project in the Pyramid framework and configure it with Zappa
  • Generate SSL Certificates using Amazon Certificate Manager
  • Configure custom domains with AWS Route 53
  • Create a Docker container similar to AWS Lambda
Estimated delivery fee Deliver to Finland

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 30, 2018
Length: 324 pages
Edition : 1st
Language : English
ISBN-13 : 9781788837613
Vendor :
Amazon
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Finland

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Jul 30, 2018
Length: 324 pages
Edition : 1st
Language : English
ISBN-13 : 9781788837613
Vendor :
Amazon
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 116.97
Building Serverless Applications with Python
€41.99
Docker on Amazon Web Services
€41.99
Building Serverless Python Web Services with Zappa
€32.99
Total 116.97 Stars icon

Table of Contents

14 Chapters
Amazon Web Services for Serverless Chevron down icon Chevron up icon
Getting Started with Zappa Chevron down icon Chevron up icon
Building a Flask Application with Zappa Chevron down icon Chevron up icon
Building a Flask-Based REST API with Zappa Chevron down icon Chevron up icon
Building a Django Application with Zappa Chevron down icon Chevron up icon
Building a Django REST API with Zappa Chevron down icon Chevron up icon
Building a Falcon Application with Zappa Chevron down icon Chevron up icon
Custom Domain with SSL Chevron down icon Chevron up icon
Asynchronous Task Execution on AWS Lambda Chevron down icon Chevron up icon
Advanced Zappa Settings Chevron down icon Chevron up icon
Securing Serverless Applications with Zappa Chevron down icon Chevron up icon
Zappa with Docker Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Amazon Customer May 20, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice
Amazon Verified review Amazon
Empty Mailbox Mar 27, 2019
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Being new to AWS I was looking for a slightly deeper dive than an admin book could provide. Barguzar's book explained everything quite simply, while providing practical examples every step of the way.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela