← Back to all products
$49
Terraform Module Registry
6 reusable, validated Terraform modules for common AWS patterns (networking, storage, IAM, security, containers, databases) plus an offline Python registry tool for indexing, docs generation, and version management.
JSONPythonTerraformMarkdownAWSCI/CD
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 45 files
terraform-module-registry/
├── LICENSE
├── README.md
├── docs/
│ ├── architecture.md
│ ├── usage-guide.md
│ └── versioning.md
├── examples/
│ └── dev-environment/
│ ├── main.tf
│ └── terraform.tfvars
├── free-sample.zip
├── guide/
│ ├── 01_what-s-included.md
│ ├── 02_architecture-overview.md
│ ├── 03_cost-estimates.md
│ └── 04_license.md
├── index.html
├── modules/
│ ├── ecs-service/
│ │ ├── README.md
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ ├── variables.tf
│ │ └── versions.tf
│ ├── iam-role/
│ │ ├── README.md
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ ├── variables.tf
│ │ └── versions.tf
│ ├── rds-instance/
│ │ ├── README.md
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ ├── variables.tf
│ │ └── versions.tf
│ ├── s3-bucket/
│ │ ├── README.md
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ ├── variables.tf
│ │ └── versions.tf
│ ├── security-group/
│ │ ├── README.md
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ ├── variables.tf
│ │ └── versions.tf
│ └── vpc-network/
│ ├── README.md
│ ├── main.tf
│ ├── outputs.tf
│ ├── variables.tf
│ └── versions.tf
├── registry.json
└── scripts/
└── registry.py
📖 Documentation Preview README excerpt
Terraform Module Registry
Production-grade Terraform modules with an offline Python registry tool for indexing, documentation generation, and version management.
A curated collection of 6 reusable Terraform modules covering the most common AWS infrastructure patterns — networking, storage, IAM, security, containers, and databases. Each module ships with validation blocks, sane defaults, and comprehensive documentation. The included registry tool scans modules offline and generates a JSON index and Markdown docs without requiring the terraform binary.
What's Included
Terraform Modules (6)
| Module | Description | Inputs | Outputs |
|---|---|---|---|
vpc-network | VPC with public/private subnets, IGW, NAT Gateway, route tables, flow logs | 13 | 10 |
s3-bucket | Hardened S3 bucket with versioning, encryption, lifecycle rules, public access block | 11 | 4 |
iam-role | IAM role with trust policy, managed/inline policies, permissions boundary, instance profile | 11 | 5 |
security-group | VPC security group with dynamic ingress/egress rules and lifecycle management | 6 | 3 |
ecs-service | ECS Fargate service with task definition, CloudWatch logging, ALB, auto-scaling | 38 | 5 |
rds-instance | RDS database with subnet group, parameter group, encryption, monitoring, alarms | 33 | 7 |
Registry Tool (1)
| Script | Purpose |
|---|---|
scripts/registry.py | Offline CLI: scan modules, build registry.json index, generate Markdown docs |
Documentation (3)
| Document | Content |
|---|---|
docs/architecture.md | Registry design, module composition patterns, CI/CD integration |
docs/usage-guide.md | Step-by-step guide to consuming modules in your projects |
docs/versioning.md | Semver policy, constraint syntax, upgrade strategy |
Examples (1)
| Example | Content |
|---|---|
examples/dev-environment/ | Root module wiring vpc-network + security-group + rds-instance, with terraform.tfvars |
Requirements
- Terraform >= 1.5.0 (for module deployment)
- AWS CLI v2 with configured credentials
- Python 3.10+ (for the registry tool — stdlib only, no pip install needed)
- No external Python packages required
- No
terraformbinary required for the registry tool
Quick Start
1. Explore Modules
# Scan all modules and display a summary
python3 scripts/registry.py --scan
# Build the registry index (writes registry.json)
python3 scripts/registry.py --scan --index
# Generate Markdown documentation for all modules
python3 scripts/registry.py --scan --docs
*... continues with setup instructions, usage examples, and more.*
📄 Code Sample .py preview
scripts/registry.py
#!/usr/bin/env python3
"""
Terraform Module Registry — Offline Module Indexer & Documentation Generator
Scans a directory of Terraform modules, parses each module's variables,
outputs, version constraints, and metadata, then builds a registry.json
index and generates per-module Markdown documentation tables.
Usage:
python3 registry.py --scan # Scan modules and print summary
python3 registry.py --scan --index # Scan + write registry.json
python3 registry.py --scan --docs # Scan + print Markdown docs
python3 registry.py --scan --index --docs # Scan + index + docs
python3 registry.py --list # List registered modules from registry.json
python3 registry.py --help # Show this help
This script uses only Python stdlib — no external dependencies required.
It parses .tf files as text and does NOT require the `terraform` binary.
"""
from __future__ import annotations
import argparse
import json
import os
import re
import sys
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
# ─── Data Classes ────────────────────────────────────────────
@dataclass
class Variable:
"""A Terraform input variable."""
name: str
description: str = ""
type: str = "string"
default: str | None = None
required: bool = True
validation: str = ""
def to_dict(self) -> dict[str, Any]:
return {
"name": self.name,
"description": self.description,
"type": self.type,
"default": self.default,
# ... 686 more lines ...