Development Setup

July 16, 2026 ยท View on GitHub

This guide will help you set up your development environment for working with Terraform modules.

Prerequisites

Development Container

This repository includes a development container configuration that provides a consistent development environment. To use it:

  1. Install the Remote - Containers extension in VS Code
  2. Open this repository in VS Code
  3. 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:

  1. Install Terraform (version specified in module's versions.tf)
  2. Install terraform-docs
  3. Install tfsec
  4. Install pre-commit
  5. Install AWS CLI and configure credentials
  6. 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:

  1. Navigate to the module's examples/ directory
  2. Initialize Terraform: terraform init
  3. Plan the changes: terraform plan
  4. Apply if the plan looks good: terraform apply

Next Steps