Skip to main content

Quick Reference

Common commands and workflows for DocuStack development.

Repository Locations

RepositoryPurposeLocal Path
docustack-monoApplication code~/development/docustack/docustack-mono
docustack-infrastructure-modulesTerraform modules~/development/docustack/docustack-infrastructure-modules
docustack-infrastructure-liveEnvironment configs~/development/docustack/docustack-infrastructure-live

Infrastructure Commands

Terragrunt Operations

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

# Plan changes
terragrunt plan

# Apply changes
terragrunt apply

# Destroy resources
terragrunt destroy

Terrateam (CI/CD)

# In PR comments:
terrateam plan # Plan all affected stacks
terrateam apply # Apply all planned changes
terrateam plan <stack> # Plan specific stack
terrateam apply <stack> # Apply specific stack

Lambda Development

# Navigate to Lambda directory
cd docustack-mono/services/lambdas/<function-name>

# Install dependencies
pip install -r requirements.txt

# Run tests
pytest

# Package for deployment
zip -r function.zip . -x "*.pyc" -x "__pycache__/*" -x "tests/*"

Deployment Order

Infrastructure must be deployed in this order due to dependencies:

  1. Layer 0: bootstrap (S3 + DynamoDB for state)
  2. Layer 1: vpc, github-actions-oidc
  3. Layer 2: ecr, ecs-cluster, rds
  4. Layer 3: bastion, ip-whitelist, nightly-scheduler
  5. Layer 4: db-init-lambda, temporal
  6. Layer 5: slack-bot, bastion-orchestrator, infra-orchestrator

Useful AWS Commands

# List ECS services
aws ecs list-services --cluster docustack-dev

# View Lambda logs
aws logs tail /aws/lambda/<function-name> --follow

# Check RDS status
aws rds describe-db-instances --db-instance-identifier docustack-dev