Skip to main content

Infrastructure Overview

DocuStack infrastructure is managed using Terraform modules deployed via Terragrunt, following the Gruntwork two-repository pattern.

Repository Structure

RepositoryPurpose
docustack-infrastructure-modulesReusable, versioned Terraform modules
docustack-infrastructure-liveEnvironment-specific configurations

Module Categories

Core Infrastructure

Foundation modules that other components depend on:

  • Bootstrap - S3 + DynamoDB for Terraform state
  • VPC - HIPAA-compliant networking
  • ECS Cluster - Fargate compute platform
  • ECR - Container registry
  • RDS - PostgreSQL database

Database & Workflows

Secure Access

Cost Management

ChatOps

Security & Compliance

Deployment Order

Infrastructure must be deployed in dependency order:

Layer 0: bootstrap

Layer 1: vpc, github-actions-oidc

Layer 2: ecr, ecs-cluster, rds

Layer 3: bastion, ip-whitelist, nightly-scheduler

Layer 4: db-init-lambda, temporal

Layer 5: slack-bot, bastion-orchestrator, infra-orchestrator

Quick Commands

# Navigate to module in live repo
cd docustack-infrastructure-live/dev/us-east-1/<module>

# Plan changes
terragrunt plan

# Apply changes
terragrunt apply

# Via Terrateam (in PR comments)
terrateam plan
terrateam apply

Next Steps