Hands-On LabIntermediate

Manage Resource Drift and Terraform State Operations

Detect resource drift, reconcile infrastructure changes, and perform Terraform state operations on Azure resources.

60 minEstimated time
5Guided steps
AutoVerification
IsolatedSandbox
Manage Resource Drift and Terraform State Operations

Lab overview

Terraform maintains a state file that represents the intended configuration of your cloud resources. Over time, manual changes through the portal or CLI cause the actual infrastructure to diverge from the declared state - a condition known as resource drift. Detecting and reconciling drift is a critical operational skill because unaddressed drift leads to unpredictable deployments, configuration conflicts, and potential outages.

In this lab, you will deploy Azure resources using Terraform, introduce drift by making out-of-band changes, detect and reconcile the drift using plan and apply, manipulate state entries with terraform state commands, and refactor resource addresses using moved blocks.

Objectives

Upon completing this intermediate level lab, you will be able to:

  • Deploy Azure storage accounts and virtual networks using Terraform
  • Detect resource drift by comparing planned state against actual infrastructure
  • Reconcile drift using terraform apply to restore declared configuration
  • Use terraform state mv, rm, and import to manipulate state entries
  • Refactor Terraform configurations with moved blocks to rename resources safely

Who is this lab for?

This lab is designed for:

  • Cloud engineers who manage Terraform-provisioned infrastructure and need to handle drift
  • DevOps engineers looking to strengthen their Terraform state management skills
  • Platform engineers responsible for maintaining infrastructure consistency across environments

Verified against your live environment

An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.

[CHECK] validation_activelive
Inspecting deployed resources...
Verifying configuration state...
✓ Step requirements satisfied

More labs like this

PremiumIncluded in Premium
Duration
60 min
Steps
5

Environment

Browser Code IDELive Cloud Environment

Every lab includes

  • Real environment, pre-credentialed
  • Automated checks on every step
  • Isolated sandbox, auto cleanup
  • AI-recommended next steps

Lab curriculum

  1. 01

    Logging into Azure CLI

  2. 02

    Deploying Azure Resources Using a Terraform Configuration

    1 automated check

  3. 03

    Detecting and Reconciling Resource Drift with Terraform

    1 automated check

  4. 04

    Manipulating Terraform State Entries and Imports

    1 automated check

  5. 05

    Refactoring Resource Addresses Using Terraform Moved Blocks

    1 automated check

Skills validated

Terraform

Not the lab you were looking for?

Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.

Explore the catalog