terraform-search-import — Claude Code skill: how to install
Discovers untracked cloud assets and sets up Terraform configuration for bulk state imports. Helpful during infrastructure migrations and audits.
npx skills add hashicorp/agent-skills --skill terraform-search-import -a claude-codeWhat terraform-search-import does
This skill guides assistants through searching active cloud services and turning them into Terraform configurations. It drafts .tfquery.hcl files using list blocks, executes terraform query, and extracts resource declarations alongside import definitions.
The process relies on ./scripts/list_resources.sh to check what the target provider actually supports before running searches. It handles variable filtering and passes output through the -generate-config-out flag.
Your workspace must run Terraform 1.14 or newer with compatible provider schemas. Once files are generated, computed attributes like generated IDs must still be trimmed manually.
What it helps with
- locate untracked cloud assets without clicking web consoles
- draft configuration files for discovered virtual instances
- inspect provider schemas for query block compatibility
- bring unmanaged infrastructure into state via batch import
Example prompts for the agent
- Search for all active EC2 instances in us-west-2 using a
.tfquery.hcllist block - Run
./scripts/list_resources.sh awsto verify if S3 buckets support search queries - Execute
terraform query -generate-config-out=imported.tfand strip out read-only attributes
How to install terraform-search-import
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill terraform-search-import -a claude-code2Manually: put the files in place
~/.claude/skills/terraform-search-import/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/terraform-search-import/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill terraform-search-import -a codex2Manually: put the files in place
.agents/skills/terraform-search-import/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill terraform-search-import -a cursor2Manually: put the files in place
.cursor/skills/terraform-search-import/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hashicorp/agent-skills terraform-search-import2Manually: put the files in place
.github/skills/terraform-search-import/SKILL.md1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill terraform-search-import -a gemini-cli2Platform CLI
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/terraform/skills/terraform-search-importManually: put the files in place
.devin/skills/terraform-search-import/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill terraform-search-import -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about terraform-search-import
How to install terraform-search-import in Claude Code?
Run npx skills add hashicorp/agent-skills --skill terraform-search-import -a claude-code. The tool adds the skill directly to your Claude Code workspace.
What does terraform-search-import do?
It automates infrastructure discovery using declarative search queries. The agent builds import statements and resource blocks to place existing components under IaC control.
What are the version requirements for this skill?
You need Terraform 1.14 or higher and an initialized provider that supports list resources. Earlier releases lack the query and schema capabilities needed for discovery.