Skip to main content

A terraform multi-repo module AI RAG ingestion engine that accepts a YAML file of terraform git repository sources, downloads them locally using existing credentials, creates JSON summaries of their purpose, inputs, outputs, and providers on the main and git tag branches for ingestion via a RAG pipeline into a vector database.

Project description

Terraform Ingest

A Terraform RAG ingestion engine that accepts a YAML file of terraform git repository sources, downloads them locally using existing credentials, creates JSON summaries of their purpose, inputs, outputs, and providers for branches or tagged releases you specify and embeds them into a vector database for similarity searches. Includes an easy to use cli, API, or MCP server.

Features

  • 📥 Multi-Repository Ingestion: Process multiple Terraform repositories from a single YAML configuration
  • 🔄 Auto-Import: Import repositories from GitHub organizations and GitLab groups (Bitbucket support coming soon)
  • 🔍 Comprehensive Analysis: Extracts variables, outputs, providers, modules, and descriptions
  • 🏷️ Branch & Tag Support: Analyzes both branches and git tags of your choosing
  • 🔌 Dual Interface: Use as a CLI tool (Click) or as a REST API service (FastAPI)
  • 🤖 MCP Integration: MCP service for AI agent access to ingested modules via STDIO, SSE, or Streamable-http
  • 📊 JSON Output: Generates structured JSON summaries ready for RAG ingestion
  • 🔐 Credential Support: Uses existing git credentials for private repositories
  • 🧠 Vector Database Embeddings: Semantic search with ChromaDB, OpenAI, Claude, or sentence-transformers

Further documentation found here

Or, if you just want the TLDR on using this as an MCP server (along with some examples) check this out.

An example project repo with a large list of custom modules for kicking the tires can be found here

Installation

This application can be run locally using uv or docker.

NOTE uv is required for lazy-loading some large dependencies.

uv tool install terraform-ingest

# Create a config
uv run terraform-ingest init config.yaml

# Or import repositories from a GitHub organization
uv run terraform-ingest import github --org terraform-aws-modules --terraform-only

# Or import repositories from a GitLab group
uv run terraform-ingest import gitlab --group mygroup --recursive --terraform-only

# Update your config.yaml file to include your terraform module information and mcp config then preform the initial ingestion
uv run terraform-ingest ingest config.yaml

# Run a quick cli search to test things out
uv run terraform-ingest search "vpc module for aws"

## Docker
docker pull ghcr.io/zloeber/terraform-ingest:latest

# Run with volume mount for persistence, ingest modules from local config.yaml file
docker run -v $(pwd)/repos:/app/repos -v $(pwd)/output:/app/output -v $(pwd)/config.yaml:/app/config.yaml ghcr.io/zloeber/terraform-ingest:latest ingest /app/config.yaml

# Run as MCP server
docker run -v $(pwd)/repos:/app/repos -v $(pwd)/output:/app/output -v $(pwd)/config.yaml:/app/config.yaml -p 8000:8000 ghcr.io/zloeber/terraform-ingest:latest mcp -c /app/config.yaml

# Search for modules and get the first result, show all details
terraform-ingest search "vpc module for aws" -l 1 -j | jq -r '.results[0].id' | xargs -I {} terraform-ingest index get {}

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terraform_ingest-0.1.21.tar.gz (370.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terraform_ingest-0.1.21-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

Details for the file terraform_ingest-0.1.21.tar.gz.

File metadata

  • Download URL: terraform_ingest-0.1.21.tar.gz
  • Upload date:
  • Size: 370.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for terraform_ingest-0.1.21.tar.gz
Algorithm Hash digest
SHA256 35a3a5cbf8aa6e5a47b79f36d5ca1d1bf312ba853d3a614cc8739fddb5497814
MD5 4df0ed997aa2f152e0a61ccf870fa08d
BLAKE2b-256 807886aadbdb424602c6ec4475ad9a372551aa224d1bef82ec5b52fed32939c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for terraform_ingest-0.1.21.tar.gz:

Publisher: release.yaml on zloeber/terraform-ingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file terraform_ingest-0.1.21-py3-none-any.whl.

File metadata

File hashes

Hashes for terraform_ingest-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 ed7bd9be8e0b778750ddd07447adb8a8e7397946637e1e804d1cc9bf1aa6ffbc
MD5 3107a2fa67fde29535852fa8604ca92a
BLAKE2b-256 19ab6c8d2551b55cd113c80e18b4a4dc38139e445de808e34ccf5a4bb0465f9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for terraform_ingest-0.1.21-py3-none-any.whl:

Publisher: release.yaml on zloeber/terraform-ingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page