In this hands-on lab, we will walk through proper ways to update CloudFormation stacks. We will first update a stack with direct updates and then use change sets to update a stack. In the process, we will create multiple change sets and view the behavior of the stack when a change set is applied.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Deploy a LAMP Stack Using an AWS CloudFormation Template
- Navigate to the CloudFormation console to create the stack.
- Upload the LAMP stack template provided with the lab and create the stack.
- Select your VPC and two subnets in the template.
Note: You will need to create a key pair in the EC2 console before you can deploy the template.
- Once it is deployed, check the CloudFormation outputs for the DNS name of the load balancer.
- Copy the URL into a browser to verify the sample site has deployed correctly.
- Use an Update Stack to Scale Up
- In the CloudFormation console, update the stack and change the instance type from
t3.small
tot3.medium
on the Parameters page. - Using the load balancer URL, verify that our server comes up and the site becomes available once more.
- In the CloudFormation console, update the stack and change the instance type from
- Use a Change Set to Scale Out
- Use a CloudFormation change set to add a second server to the template in another subnet and ensure that it is added to the load balancer.
- View and then execute the change set.
- Once it is finished, use the load balancer DNS name to confirm the site is up and running.