Quick Reference
Common commands and workflows for DocuStack development.
Repository Locations
| Repository | Purpose | Local Path |
|---|---|---|
docustack-mono | Application code | ~/development/docustack/docustack-mono |
docustack-infrastructure-modules | Terraform modules | ~/development/docustack/docustack-infrastructure-modules |
docustack-infrastructure-live | Environment 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:
- Layer 0:
bootstrap(S3 + DynamoDB for state) - 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
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