terraform-search-import

Discovers existing Azure resources and generates Terraform import blocks for bulk adoption into IaC.

Updated May 12, 2026
One-click install
npx skills add https://github.com/sohamda/apex-try-out-demo-repo --skill terraform-search-import-sohamda
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terraform-search-import
Source: https://github.com/sohamda/apex-try-out-demo-repo/tree/main/.github/skills/terraform-search-import
Command: npx skills add https://github.com/sohamda/apex-try-out-demo-repo --skill terraform-search-import-sohamda

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires terraform, jq, and includes scripts (resource) and references (resource) components.

What problem does it solve? Bringing existing, manually created Azure resources under Terraform management is tedious and error-prone. This Skill automates the discovery of Azure resources and the generation of Terraform import blocks so unmanaged infrastructure can be adopted into Infrastructure as Code without recreation. ## Core Features & Use Cases - Manual Discovery Workflow: Uses az resource list and resource-specific Azure CLI commands to inventory resources, then generates resource and import blocks validated with terraform plan before apply. - Experimental Terraform Search: Supports Terraform >= 1.14 .tfquery.hcl list blocks with terraform query -generate-config-out when the azurerm provider supports list_resource_schemas. - Post-Import Modernization: Guides refactoring of raw azurerm_* resources into AVM modules using moved {} blocks, plus bulk import scripts and an ARM-type-to-Terraform mapping table. - Use Case: A platform team inherits a production resource group created through the Azure portal. They run the manual discovery workflow to list all resources, generate import blocks, verify the plan shows imports only, and apply — bringing everything under Terraform in one session. ## Quick Start Ask the agent to discover all resources in your Azure resource group and generate Terraform import blocks for them.

Frequently Asked Questions about terraform-search-import

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import existing Azure resources into Terraform?▼

Use the manual discovery workflow: list resources with az resource list, create resource and import blocks for each, then run terraform plan to confirm only import actions appear before applying. Import IDs follow the format /subscriptions/{sub}/resourceGroups/{rg}/providers/{type}/{name}.

How to bulk import an entire Azure resource group into Terraform?▼

Run az resource list --resource-group to export all resources as JSON, then use the bulk import script to generate import blocks per resource. Map ARM types to Terraform resource types using the provided mapping table, then plan and apply.

Does Terraform Search work with the azurerm provider?▼

Terraform Search requires Terraform >= 1.14 and azurerm support for list_resource_schemas, which is currently TBD. Treat it as experimental and use the manual az CLI discovery workflow as the reliable default path.

Why does terraform plan show changes after importing Azure resources?▼

Post-import drift usually comes from provider default attributes or azurerm 4.x renames such as allow_blob_public_access becoming allow_nested_items_to_be_public. Pin the provider to ~> 4.0 and align configuration with the actual resource state.

When should I not use this Terraform import workflow?▼

Do not use it for Bicep code, new resource creation, or architecture decisions — those belong to dedicated Bicep, Terraform patterns, and ADR workflows. It is scoped to discovering and importing existing Azure resources only.