
Terraform Search Import
This automates the tedious process of bringing existing cloud infrastructure under Terraform management using the new Terraform Search feature. Instead of manually writing import blocks for dozens of resources, you write declarative queries in .tfquery.hcl files to discover resources by filters like tags or regions, then bulk generate both the resource configurations and import blocks. The workflow is straightforward: check if your resource type supports list operations (there's a script for that), write your query, run terraform query with the generate flag, clean up the output, and apply. One catch worth knowing upfront: this requires Terraform 1.14+ and provider support is still expanding, so you'll need to verify your specific resource types are covered before diving in.
- skills.sh installs
- 5.1K
- GitHub stars
- 924
- last updated
- Aug 21, 2026
Install
$ npx -y skills add hashicorp/agent-skills --skill terraform-search-import --agent claude-codeInstalls into .claude/skills of the current project.
Files
Terraform Search and Bulk Import
Discover existing cloud resources using declarative queries and generate configuration for bulk import into Terraform state.
References:
When to Use
- Bringing unmanaged resources under Terraform control
- Auditing existing cloud infrastructure
- Migrating from manual provisioning to IaC
- Discovering resources across multiple regions/accounts
IMPORTANT: Check Provider Support First
BEFORE starting, you MUST verify the target resource type is supported:
# Check what list resources are available
./scripts/list_resources.sh aws # Specific provider
./scripts/list_resources.sh # All configured providers
Decision Tree
Sponsors
Details
- Repository
- github.com/hashicorp/agent-skills
- Categories
- DevOps & CI/CD, AI & Agent Building, Cloud & Infrastructure
- First seen
- Apr 16, 2026
More from hashicorp/agent-skills
All 16- Provider Resources4.2K
- New Terraform Provider4K
- Provider Actions4K
- Run Acceptance Tests3.8K
- Azure Verified Modules3.4K
- Provider Test Patterns3.4K
- Provider Docs3.3K
- Aws Ami Builder3.3K
- Push To Registry3.1K
- Azure Image Builder2.8K
- Windows Builder2.8K
- Terraform Style Guide13.2K
- Terraform Test9.2K
- Refactor Module6.6K
- Terraform Stacks5.8K