Introduction

Lesson Objectives

In the previous lesson, we built the necessary networking infrastructure as a part of ourdemoinfra stack for a web application: a VPC, subnets, internet gateway, NAT gateway, and routing tables.

In the current lesson, we will create a new stack demoserverstack, that will create servers and associated resources in the previously created VPC. Yes, we will cross-reference the resources created in the previous stack in our new stack.

In particular, we will create the following resources using the CloudFormation template:

  • Security groups – Security group specify firewall rules. We will create two of them, one for a load-balancer and another for a web server.
  • AutoScaling group – An autoscaling group ensures that a desired number of servers (EC2 instances) are always up and running. If an instance goes down due to any reason, such as bad health, a substitute instance with a similar configuration will spin up automatically.
  • Launch configuration – The configuration of the EC2 instance that spins up automatically, if required, as a part of autoscaling group resides in a launch configuration.
  • Load balancer – A load balancer distributes the incoming traffic uniformly across multiple servers (target group) within the same or different AZs. We will also create a listener and target group for the load balancer.

Supporting Material

The supporting material that is referred to in the video demonstration is available in the Github repository folder.