import-infrastructure-as-code

Installation
Summary

Reverse-engineer live Azure infrastructure into Terraform code using Azure Verified Modules.

  • Discovers Azure resources across subscription, resource group, or specific resource ID scopes using Azure CLI, then maps dependencies and generates AVM-based Terraform configuration
  • Requires reading each AVM module's README before code generation to identify required inputs, child resource ownership, and exact variable names that differ from raw azurerm_* provider arguments
  • Generates import blocks by inspecting downloaded module source code to derive correct resource addresses, accounting for provider type (azurerm vs azapi), sub-module nesting, and count/for_each patterns
  • Produces providers.tf, main.tf, variables.tf, outputs.tf, and documentation files (exported-resources.json, EXPORTED-ARCHITECTURE.md) with full validation via terraform plan
  • Validates live resource properties against AVM module defaults to prevent configuration drift, explicitly setting any differing values in the generated configuration
SKILL.md

Import Infrastructure as Code (Azure -> Terraform with AVM)

Convert existing Azure infrastructure into maintainable Terraform code using discovery data and Azure Verified Modules.

When to Use This Skill

Use this skill when the user asks to:

  • Import existing Azure resources into Terraform
  • Generate IaC from live Azure environments
  • Handle any Azure resource type supported by AVM (and document justified non-AVM fallbacks)
  • Recreate infrastructure from a subscription or resource group
  • Map dependencies between discovered Azure resources
  • Use AVM modules instead of handwritten azurerm_* resources

Prerequisites

  • Azure CLI installed and authenticated (az login)
  • Access to the target subscription or resource group
Related skills

More from github/awesome-copilot

Installs
6.5K
GitHub Stars
32.8K
First Seen
Mar 2, 2026