Development Setup
July 16, 2026 ยท View on GitHub
This guide will help you set up your development environment for working with Terraform modules.
Prerequisites
- Git
- Docker
- Visual Studio Code (recommended)
- AWS CLI (for AWS modules)
- MongoDB Atlas CLI (for MongoDB modules)
Development Container
This repository includes a development container configuration that provides a consistent development environment. To use it:
- Install the Remote - Containers extension in VS Code
- Open this repository in VS Code
- When prompted, click "Reopen in Container" or use the command palette (F1) and select "Remote-Containers: Reopen in Container"
The development container includes:
- Terraform CLI
- terraform-docs
- tfsec
- Terragrunt
- AWS CLI
- MongoDB Atlas CLI
- Pre-commit hooks
- Linting tools
Local Setup (Alternative)
If you prefer to set up your environment locally:
- Install Terraform (version specified in module's
versions.tf) - Install terraform-docs
- Install tfsec
- Install pre-commit
- Install AWS CLI and configure credentials
- Install MongoDB Atlas CLI if working with MongoDB modules
Pre-commit Hooks
This repository uses pre-commit hooks to ensure code quality. To set them up:
# Install pre-commit
pip install pre-commit
# Install the git hooks
pre-commit install
The hooks will run automatically on commit and include:
- Terraform formatting
- Terraform documentation generation
- Terraform security checks
- Markdown linting
- Code duplication checks
Environment Variables
If your development workflow requires environment variables, create a local
.envrc file with the required values and load it using direnv:
direnv allow
Testing
To test modules locally:
- Navigate to the module's
examples/directory - Initialize Terraform:
terraform init - Plan the changes:
terraform plan - Apply if the plan looks good:
terraform apply
Next Steps
- Read the Modules Guide to understand how to use and create modules
- Review the Best Practices for module development
- Check the Contributing Guidelines if you want to contribute