Agent skill · hashicorp

terraform-search-import

Discover existing cloud resources using Terraform Search queries and bulk import them into Terraform management. Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC.

What it needs

About 5k tokens when loaded.

What this skill does

Terraform Search and Bulk Import Discover existing cloud resources using declarative queries and generate configuration for bulk import into Terraform state. References: Terraform Search - list block Bulk Import 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: Decision Tree 1. Identify target resource type (e.g., awss3bucket, awsinstance) 2. Check if supported: Run ./scripts/listresources.sh <provider> 3. Choose workflow: If supported: Check for terraform version available. If terraform version is above 1.14.0 Use Terraform Search workflow (below) If not supported or terraform version is below 1.14.0 : Use Manual Discovery workflow (see references/MANUAL-IMPORT.md) Note: The list of supported resources is rapidly expanding. Always verify current support before using manual import. Prerequisites Before writing queries, verify the provider supports list resources for your target resource type. Discover Available List Resources Run the helper script to extract supported list resources from your provider: Or manually query the provider schema: Terraform Search requires an initialized working directory. Ensure you have a configuration with the required provider before running queries: Run terraform init to download the provider, then proceed with queries. Terraform Search Workflow (Supported Resources Only) 1. Create .tfquery.hcl files with list blocks defining search queries 2. Run terraform query to discover matching resources 3. Generate configuration with -generate-config-out=<file> 4. Review and refine generated resource and import blocks 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills hashicorp/terraform-search-import--df2e78

View the source on GitHub

Browse the @skills marketplace