hashicorp avatar

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-code

Installs 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
1recoupable avatarrecoup-platform-build-osrecoupable/skillsScaffold and run a label's self-managing "music-company OS" inside its own git repo — the full label-intelligence workspace (folders, a self-managing CLAUDE.md 5.1Kskills.sh installs
2boristane avatarlogging-best-practicesboristane/agent-skillslogging best practices5Kskills.sh installs
3affaan-m avatarkubernetes-patternsaffaan-m/eccKubernetes workload patterns, resource management, RBAC, probes, autoscaling, ConfigMap/Secret handling, and kubectl debugging for production-grade deployments.4.9Kskills.sh installs
4affaan-m avatarorch-build-mvpaffaan-m/eccOrchestrate bootstrapping a working MVP from a design or spec document — ingest the doc, plan thin vertical slices, scaffold the first end-to-end slice, then TD4.8Kskills.sh installs
5claude-office-skills avatardoc-pipelineclaude-office-skills/skillsChain document operations into reusable pipelines4.7Kskills.sh installs
6affaan-m avatarralphinho-rfc-pipelineaffaan-m/everything-claude-coderalphinho rfc pipeline4.7Kskills.sh installs