GitHub Template Repository for Creating Terraform Modules
Status: Production Ready
Last Updated: 2025-11-14
This is a GitHub template repository for creating new Terraform modules with comprehensive CI/CD, documentation, testing, and best practices built-in.
- Click "Use this template" on GitHub to create a new repository
- Clone your new repository:
git clone https://github.com/dtlr/your-new-module-name cd your-new-module-name - Follow the setup guide: See SETUP-GUIDE.md for detailed instructions
This template provides:
- ✅ GitHub Actions CI/CD - Validation, linting, security scanning, releases
- ✅ Pre-commit hooks - Automatic formatting and validation
- ✅ Security scanning - tfsec, Checkov, and Trivy integration
- ✅ Documentation generation - terraform-docs automation
- ✅ TFLint configuration - Provider-specific linting rules
- ✅ Example structure - Basic and advanced usage examples
- ✅ Testing framework - Terratest integration setup
- ✅ Semantic versioning - Automated releases with conventional commits
terraform-module-template/
├── .github/workflows/ # CI/CD pipelines
├── docs/ # Documentation templates
├── examples/ # Usage examples (basic/advanced)
├── tests/ # Testing framework setup
├── .pre-commit-config.yaml # Pre-commit hooks
├── .terraform-docs.yml # Documentation generation
├── .tflint.hcl # Linting configuration
├── README-TEMPLATE.md # Template for your module README
└── SETUP-GUIDE.md # Step-by-step setup instructions
- Follow SETUP-GUIDE.md - Complete step-by-step setup
- Implement your module - Create main.tf, variables.tf, outputs.tf, versions.tf
- Customize README.md - Use README-TEMPLATE.md as starting point
- Create examples - Add working examples in examples/ directories
- Configure GitHub secrets - Add provider credentials for CI/CD
- Test and release - Create your first v1.0.0 release
- SETUP-GUIDE.md - Complete setup instructions
- README-TEMPLATE.md - README template for your module
- docs/MIGRATION-GUIDE.md - Migration guide template
- examples/ - Example templates
- Terraform validation and formatting
- Security scanning with multiple tools
- Automated documentation generation
- Semantic versioning with conventional commits
- Integration testing with Terratest
- Provider-specific linting rules
Maintained by DTLR Engineering Team. Submit PRs to improve the template.
Ready to create your first Terraform module? Click "Use this template" to get started! 🚀