tf-registry
A high-performance, asynchronous implementation of the Terraform Provider Registry protocol. Built with Tokio and Axum, it allows you to serve private Terraform providers natively using GitHub Releases as a storage backend.
- Cost-Effective: Replace expensive IaC management platforms with a tiny, serverless-friendly binary.
- Zero Storage Overhead: Uses GitHub Releases as the source of truth. No S3 buckets or databases to manage.
- Native Experience: Supports the full
terraform initworkflow. No more network or file mirror hacks or manual binary injections. - Built for Scale: Leveraging Axum and Tokio, it handles concurrent provider downloads in large CI/CD pipelines with minimal CPU/RAM usage.
🚀 Why tf-registry?
Modern infrastructure teams often outgrow public registries but face significant hurdles when managing private providers. This crate exists to provide a middle ground between "expensive enterprise platforms" and "manual hackery."
1. Cost Optimization
Enterprise solutions like Terraform Cloud or Harness IaC Management charge significant premiums for private registry functionality. tf-registry allows teams to self-host a private registry as a lightweight container (ECS/Kubernetes) or a serverless function (Lambda/Cloud Run), drastically reducing licensing overhead.
2. Native Workflow Integration
Without a registry, teams are often forced to manually inject provider binaries into CI/CD runners or use filesystem_mirror configurations.
- The Problem: Manual binary management is brittle, insecure, and hard to version.
- The Solution: This crate enables a native
terraform initworkflow. Your providers are discovered and installed automatically, just like official HashiCorp providers.
3. Automated GitHub Distribution
By leveraging GitHub Releases as a backend, this registry eliminates the need for a separate storage layer. It dynamically maps Terraform's protocol requests to your GitHub-hosted assets, providing a seamless bridge between your provider's source code and its consumption.
4. High-Performance Asynchronicity
Built with Tokio and Axum, this registry is designed to handle high-concurrency environments (like massive parallel CI/CD jobs) with minimal memory footprint, making it ideal for cost-effective serverless deployment.
🛠 Features
- ✅ Protocol Compliant: Fully implements the Provider Registry Protocol.
- ✅ GitHub Integration: Powered by
octocrabfor efficient asset discovery and fetching. - ✅ GPG Signing Support: Automates the delivery of GPG public keys so Terraform can verify provider authenticity.
🏁 Getting started
1. Requirements
- A GitHub Personal Access Token (PAT) with access to your private provider repositories.
- A GPG Public Key (Base64-encoded or PEM) used to sign your provider binaries.
2. Installation
[]
= "0.1"
= { = "1.0", = ["full"] }
3. Basic example
use Registry;
async
📂 Architecture & Workflow
- Terraform CLI requests a provider (e.g.,
registry.example.com/my-org/my-provider). tf-registryqueries the GitHub API to find matching releases and assets (zip files and SHA sums).tf-registryreturns the signed metadata, pointing Terraform to the GitHub download URL.- Terraform verifies the download using the GPG key provided by the registry.
License
This project is licensed under the MIT license.