cloudgeni-ai/opengeni/terraform-search-import
Claude Code and agent skill by cloudgeni-ai/opengeni
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install cloudgeni-ai/opengeni/terraform-search-importSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as hashicorp/agent-skills/terraform-search-import.
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:
Decision Tree
- Identify target resource type (e.g., aws_s3_bucket, aws_instance)
- Check if supported: Run
./scripts/list_resources.sh <provider> - 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)
- Create
.tfquery.hclfiles withlistblocks defining search queries - Run
terraform queryto discover matching resources - Generate configuration with
-generate-config-out=<file> - Review and refine generated
resourceandimportblocks - Run
terraform planandterraform applyto import
Query File Structure
Query files use .tfquery.hcl extension and support:
providerblocks for authenticationlistblocks for resource discoveryvariableandlocalsblocks for parameterization
List Block Syntax
Supported List Resources
Provider support for list resources varies by version. Always check what's available for your specific provider version using the discovery script.
Query Examples
Basic Discovery
Filtered Discovery
Multi-Region Discovery
Parameterized Queries
Running Queries
Query Output Format
Columns: <query_address> <identity_attributes> <name_tag>
Generated Configuration
The -generate-config-out flag creates:
Post-Generation Cleanup
Generated configuration includes all attributes. Clean up by:
- Remove computed/read-only attributes
- Replace hardcoded values with variables
- Add proper resource naming
- Organize into appropriate files
Import by Identity
Generated imports use identity-based import (Terraform 1.12+):
Best Practices
Query Design
- Start broad, then add filters to narrow results
- Use
limitto prevent overwhelming output - Test queries before generating configuration
Configuration Management
- Review all generated code before applying
- Remove unnecessary default values
- Use consistent naming conventions
- Add proper variable abstraction
Troubleshooting
| Issue | Solution | |
|---|---|---|
| "No list resources found" | Check provider version supports list resources | |
| Query returns empty | Verify region and filter values | |
| Generated config has errors | Remove computed attributes, fix deprecated arguments | |
| Import fails | Ensure resource not already in state |
Complete Example
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/runtime/src/curated_skill_library/terraform-search-import/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cloudgeni-ai/opengeni/terraform-search-import)