Initial deployments

Once you are done with initializing Zappa, then you can deploy the application on to the production stage in a single command, as shown in the following code snippet:

$ zappa deploy production
.
.
.
Deployment complete ! https://071h4br4e0.execute-api.ap-south-1.amazonaws.com/production

When you call the $ zappa deploy command, Zappa performs some tasks to complete the deployment. The following is the internal flow and process of Zappa regarding deployment:

  1. Compress the application code in your local environment into a ZIP archive by replacing any dependencies with versions in a precompiled Lambda package.
  2. Set up the Lambda handler function with the required WSGI middleware based on your application's type.
  3. Upload the generated archive from the preceding two steps into the Amazon S3 bucket.
  4. Create and manage the necessary AWS IAM policies and roles.
  5. Creates the AWS Lambda function with reference to the uploaded ZIP archive file on the AWS S3 bucket.
  6. Create the AWS API Gateway resources along with the different stages as per Zappa configuration.
  7. Create the WSGI compatible routes for the API Gateway resources.
  8. Link the API Gateway routes to the AWS Lambda functions.
  9. Finally, remove the ZIP file from AWS S3.
Note: lambda-packages ( https://github.com/Miserlou/lambda-packages) is an open source repository that's maintained by the Zappa community. This repository contains the most essential Python libraries as precompiled binaries, which will be compatible with AWS Lambda.

This is how Zappa deals with the deployment process—It completes all of these tasks on its own and gives you the honor of deploying your application with a single command.