Challenge LabIntermediate

Challenge - Import and Refactor Existing Infrastructure with Terraform

Bring pre-existing Azure resources under Terraform management without recreating them, reconcile your configuration to a zero-change plan, then refactor the storage account into a reusable module.

60 minEstimated time
1Guided step
AutoVerification
IsolatedSandbox
Challenge - Import and Refactor Existing Infrastructure with Terraform

Lab overview

Terraform can adopt resources that were created outside it, then keep those resources running while you reshape the configuration. Import brings live Azure infrastructure into state. A moved block later relocates a resource address, for example into a module, without destroying the real resource.

You will import a pre-existing storage account, virtual network, and subnet, write configuration that produces a zero-change plan, then extract the storage account into a local module.

By completing this Intermediate challenge, you will be able to:

  • Import existing Azure resources into Terraform state without recreating them
  • Write configuration that matches live infrastructure so a plan reports no changes
  • Move a resource into a local module without changing the deployed storage account

Prerequisites

  • Terraform HCL, state, and CLI (init, plan, apply, state)
  • Azure CLI resource inspection

Recommended Lab: Introduction to Azure Terraform

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

Related reading

PremiumIncluded in Premium
Duration
60 min
Steps
1

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

    Import and Refactor Azure Resources with Terraform

    5 automated checks

Skills validated

Azure StorageTerraformInfrastructure as CodeAzure Virtual Network

Not the lab you were looking for?

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

Explore the catalog