Chapter 14. Automating deployment

 

This chapter covers

  • Using Amazon S3 to store the code of Lambda functions and trigger an automatic deployment
  • Using AWS CloudFormation to manage deployments as code
  • Managing deployments for multiregion architectures

In the previous chapter, you learned how to improve development and testing using advanced AWS Lambda features and frameworks that simplify the programming experience.

Now you’ll see how to automate deployment of Lambda functions using tools and services such as AWS CloudFormation templates and Amazon S3 buckets to host your code.

14.1. Storing code on Amazon S3

You used Amazon S3 multiple times in the examples in this book to store different kinds of information, such as pictures or HTML files. In the same way, you can store the ZIP file of a Lambda function on an S3 bucket.

To simplify deployment, AWS Lambda supports the deployment of a Lambda function straight from a ZIP file stored on Amazon S3. In this way, you don’t need to upload and send the ZIP file when creating or updating the code of a Lambda function. You can use any available tool (such as the S3 console, the AWS CLI, or any third-party tool supporting Amazon S3) to upload the ZIP file to an S3 bucket, and then call the CreateFunction or UpdateFunctionCode Lambda API to use the S3 object as the source of the function code. See figure 14.1.

14.2. Event-driven serverless continuous deployment

14.3. Deploying with AWS CloudFormation

14.4. Multiregion deployments

Summary

Exercise

sitemap