Chapter 10. Cloud Deployments

10.0 Introduction

The advent of cloud providers has changed the landscape of web application hosting. A process such as provisioning a new machine used to take anywhere from hours to months; now, you can create one with as little as a click or an API call. These cloud providers lease their virtual machines, called infrastructure as a service (IaaS), or managed software solutions such as databases, through a pay-per-usage model, which means you pay only for what you use. This enables engineers to build up entire environments for testing and tear them down when they’re no longer needed. These cloud providers also enable applications to scale horizontally based on performance need at a moment’s notice. This chapter covers basic NGINX deployments on a couple of the major cloud-provider platforms.

10.1 Auto-Provisioning

Problem

You need to automate the configuration of NGINX servers on Amazon Web Services (AWS) for machines to be able to automatically provision themselves.

Solution

This section will use AWS as its example; however, the core concepts of auto-provisioning will carry over to other cloud providers such as Azure, Google Cloud Platform (GCP), and DigitalOcean.

Utilize Amazon Elastic Compute Cloud (EC2) UserData as well as a prebaked Amazon Machine Image (AMI). Create an AMI with NGINX and any supporting software packages installed. Utilize EC2 UserData to configure any environment-specific configurations at runtime.

Discussion

There ...

Get NGINX Cookbook, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.