Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Using CloudFormation Drift Detection

This lab discusses CloudFormation drift detection. CloudFormation stack drift occurs when the resources in a stack have drifted from their original creation template. This can become a major problem — and drift detection can be used to identify it. After the problem is identified, the lab covers the stack update steps that can be taken to bring the CloudFormation stack back into sync with the original template.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 20, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create CloudFormation Stack
    1. In EC2, create a key pair called driftlab.
    2. Create a CloudFormation stack using the ec24drift.json template file linked in the lab instructions. Use the following stack details:
      • Stack name: driftlab
      • InstanceType: t2.micro
      • KeyName: driftlab
      • MySubnet: Select any one of the listed subnets
      • myVPC: Select the only listed VPC
      • Give the stack a "name" tag of "driftlab"
  2. Challenge

    Terminate an EC2 Instance to Introduce Stack Drift
    1. In EC2, select Instance3, and under Actions > Security > Change security groups, remove the currently selected security group, and add the default security group.
    2. Select Instance 1, and terminate the instance.
    3. Go to Networking & Security > Security Groups. For the security group with driftlab-InstanceSecurityGroup in the name, add HTTP and HTTPS inbound rules.
    4. In S3, disable static website hosting for the bucket that was created (it will have driftlab in the name).
    5. In CloudFormation, detect drift and view the results.
  3. Challenge

    Eliminate Drift from Stack
    1. In EC2, select Instance3. Under Actions > Security > Change security groups, remove the default security group, and reassign the driftlab- security group.
    2. In CloudFormation, select EC2Instance3, detect drift, and view the results for the resource to see that it is now in sync.
    3. Still in CloudFormation, update the driftlab stack by uploading the afterdriftupdate.json file (link available in the lab instructions) as the template file.
    4. Detect drift and view the results to see that all resources are in sync.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight