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

You're reading from   Building Serverless Python Web Services with Zappa Build and deploy serverless applications on AWS using Zappa

Arrow left icon
Product type Paperback
Published in Jul 2018
Publisher Packt
ISBN-13 9781788837613
Length 324 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Abdulwahid Abdulhaque Barguzar Abdulwahid Abdulhaque Barguzar
Author Profile Icon Abdulwahid Abdulhaque Barguzar
Abdulwahid Abdulhaque Barguzar
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Amazon Web Services for Serverless FREE CHAPTER 2. Getting Started with Zappa 3. Building a Flask Application with Zappa 4. Building a Flask-Based REST API with Zappa 5. Building a Django Application with Zappa 6. Building a Django REST API with Zappa 7. Building a Falcon Application with Zappa 8. Custom Domain with SSL 9. Asynchronous Task Execution on AWS Lambda 10. Advanced Zappa Settings 11. Securing Serverless Applications with Zappa 12. Zappa with Docker 13. Assessments 14. Other Books You May Enjoy

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.
You have been reading a chapter from
Building Serverless Python Web Services with Zappa
Published in: Jul 2018
Publisher: Packt
ISBN-13: 9781788837613
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime