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.

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.
More labs like this
Import Existing Infrastructure into Terraform State Management
Use Terraform import blocks and the legacy import command to bring pre-existing Azure resources under Terraform state management.
Introduction to Infrastructure as Code with Terraform on AWS
Write your first HCL configuration and deploy a DynamoDB table to AWS using Terraform's init, plan, and apply workflow.
Challenge - Build and Use a Custom Terraform Module
Build a reusable Terraform module for EC2 app tiers and deploy web and API instances using the module in AWS.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Challenge Scenario - Import and Refactor Azure Resources with Terraform
5 automated checks
Skills validated
Not the lab you were looking for?
Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.