tg-migrate-import

Generates and executes Terragrunt import scripts to bring existing Azure resources under Terraform state management.

Updated Jul 22, 2026
One-click install
npx skills add https://github.com/Trigent-Software-Pvt-Ltd/trigen-aidlc --skill tg-migrate-import-trigent-software-pvt-ltd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tg-migrate-import
Source: https://github.com/Trigent-Software-Pvt-Ltd/trigen-aidlc/tree/main/plugins/terragrunt-migrate/skills/tg-migrate-import
Command: npx skills add https://github.com/Trigent-Software-Pvt-Ltd/trigen-aidlc --skill tg-migrate-import-trigent-software-pvt-ltd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Migrating existing Azure infrastructure into Terragrunt requires manually mapping every live resource to its Terraform address and running import commands, which is error-prone and risky without review checkpoints. ## Core Features & Use Cases - Import Script Generation: Creates per-environment import-scripts/<env_key>.sh files containing terragrunt import commands for each service, mapping Azure resource IDs to Terragrunt resource addresses. - State-Aware Orchestration: Verifies via migration_get_state that the environment is populated before proceeding, and marks it imported afterward with migration_update_state. - Human Approval Gate: Presents the generated script for review and only executes after explicit confirmation, since imports modify Terraform state. - Use Case: During a Phase 4 migration of a us-centralus-dev environment, generate the import script mapping resources like azurerm_key_vault.this to their Azure IDs, review the mappings, authenticate to Azure, and execute the import. ## Quick Start Run the tg-migrate-import skill with the target repository path and environment key such as us-centralus-dev to generate and review the import script for that environment.

Frequently Asked Questions about tg-migrate-import

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

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

Generate an import script mapping each Azure resource ID to its Terragrunt resource address, then run terragrunt import commands per service. This skill creates per-environment import.sh scripts and requires your approval before executing them.

How to run terragrunt import for multiple environments?

Provide the target repository path and an environment key such as us-centralus-dev. The skill generates a dedicated import script under import-scripts/<env_key>.sh with cd and terragrunt import commands for each service in that environment.

Does terragrunt import modify my Terraform state automatically?

No execution happens without explicit approval. The skill presents the generated import script for human review first, and only runs it after you confirm, since imports directly modify Terraform state.

What happens if a resource fails to import into Terraform?

After execution, the skill reports success or failure per resource along with error messages for any resources that failed to import. The environment is only marked as imported in the migration state after the run completes.

How are count-indexed Terraform resources handled during import?

Count-indexed resources following the is_secondary pattern use bracket notation such as azurerm_resource_type.this[0] mapped to the same Azure resource ID. Primary resources use the plain address like azurerm_resource_type.this.