import-infrastructure-as-code
Import existing Azure resources into Terraform using Azure CLI discovery and Azure Verified Modules (AVM). Use when asked to reverse-engineer live Azure infrastructure, generate Infrastructure as Code from existing subscriptions/resource groups/resource IDs, map dependencies, derive exact import addresses from downloaded module source, prevent configuration drift, and produce AVM-based Terraform files ready for validation and planning across any Azure resource type.
Security Assessment
About import-infrastructure-as-code
The 'import-infrastructure-as-code' skill helps users convert existing Azure infrastructure into maintainable Terraform code using Azure CLI discovery and Azure Verified Modules (AVM). This skill addresses the need for reverse-engineering live Azure environments, allowing users to generate Infrastructure as Code (IaC) from subscriptions, resource groups, or resource IDs. The solution helps map dependencies between resources and prevents configuration drift by utilizing AVM modules rather than manually written 'azurerm_*' resources. By leveraging this skill, users can achieve consistent, reproducible infrastructure management across any Azure resource type supported by AVM.
FAQ
How do I use this skill to import resources into Terraform?
To use the skill, provide the Azure subscription ID, resource group name, or specific resource IDs as input. The skill will run discovery commands to gather data about the selected scope and generate Terraform files based on Azure Verified Modules (AVM).
Which Azure resources can be handled by this skill?
The skill supports all Azure resource types that are covered by Azure Verified Modules (AVM). For unsupported resource types, it documents fallback approaches for generating code.
What are the prerequisites to use this skill?
You need to have Azure CLI and Terraform CLI installed and authenticated. You also require access to the target subscription or resource group and network access to the Terraform Registry and AVM index sources.
Do I need to provide additional context after setting the scope?
Once the correct scope (subscription, resource group, or resource IDs) is provided, the skill uses this context to discover resources and generate the necessary Terraform code. No further input is required unless an error occurs or a specific resource scope needs to be expanded.
Install import-infrastructure-as-code
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
github/awesome-copilot