# terraform-search-import

Discovers untracked cloud assets and sets up Terraform configuration for bulk state imports. Helpful during infrastructure migrations and audits.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4900 installs · ★ 909
- Author: hashicorp
- License: MPL-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/terraform/skills/terraform-search-import/SKILL.md
- Updated: 2026-10-05
- HTML: https://affpapa.org/en/nevibecode/skills/terraform-search-import

## What it 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.

## Requirements
- Works with: Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill terraform-search-import -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/terraform-search-import/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/terraform-search-import/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill terraform-search-import -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/terraform-search-import/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill terraform-search-import -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/terraform-search-import/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hashicorp/agent-skills terraform-search-import
```

2. **Manually: put the files in place**
- File: `.github/skills/terraform-search-import/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill terraform-search-import -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/terraform/skills/terraform-search-import
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/terraform-search-import/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill terraform-search-import -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/terraform/skills/terraform-search-import/SKILL.md

## When to use it
- 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
- Search for all active EC2 instances in us-west-2 using a `.tfquery.hcl` list block
- Run `./scripts/list_resources.sh aws` to verify if S3 buckets support search queries
- Execute `terraform query -generate-config-out=imported.tf` and strip out read-only attributes

## Similar
- [terraform-engineer](https://affpapa.org/en/nevibecode/skills/terraform-engineer.md) — skill · 5400 installs
- [terraform-diagrams](https://affpapa.org/en/nevibecode/skills/terraform-diagrams.md) — skill · 745 installs
- [terraform-aws](https://affpapa.org/en/nevibecode/skills/terraform-aws.md) — skill · 387 installs
- [terraform](https://affpapa.org/en/nevibecode/plugins/terraform.md) — plugin · ★ 44635
- [iac-terraform-data-engineering](https://affpapa.org/en/nevibecode/skills/iac-terraform-data-engineering.md) — skill · 1800 installs
- [iac-data-engineering-terraform](https://affpapa.org/en/nevibecode/skills/iac-data-engineering-terraform.md) — skill · 1800 installs

From the same set: [hashicorp/agent-skills](https://affpapa.org/en/nevibecode/by/hashicorp/agent-skills.md) — 16 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
