Operations
This section covers the operational aspects of DocuStack infrastructure: deployment workflows, cost management, and day-to-day operations.
Why This Matters
DocuStack follows a GitOps-first approach where all infrastructure changes flow through pull requests. Understanding these workflows is essential for:
- Consistency: Every change is reviewed, tested, and auditable
- Safety: Automated plans prevent surprises; applies require approval
- Cost Control: Automated teardown saves ~$100/month in non-production environments
- Compliance: Full audit trail via Git history and Terrateam logs
Quick Reference
| Task | Guide | Time |
|---|---|---|
| Deploy infrastructure changes | Deployment Guide | 5-30 min |
| Stop dev resources for the night | Teardown System | 30 sec |
| Full weekend teardown | Teardown System | 10 min |
| Understand Terrateam workflow | Terrateam Guide | - |
| Protect internal services | Cloudflare Access | 15 min |
Deployment Methods
┌─────────────────────────────────────────┐
│ Deployment Methods │
└─────────────────────────────────────────┘
│
┌───────────────────────────┼───────────────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ TERRATEAM (PR) │ │ MANUAL │ │ SCHEDULED │
│ │ │ │ │ │
│ Primary method for │ │ Bootstrap, debug, │ │ Nightly stop/start │
│ all standard infra │ │ emergency fixes │ │ Weekend teardown │
│ changes │ │ │ │ │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
Cost Optimization
The teardown system provides significant savings for non-production environments:
| Strategy | Monthly Savings | Recovery Time |
|---|---|---|
| Nightly stop/start (Tier 1) | ~$54 | 2-5 minutes |
| Weekend full teardown (Tier 2) | ~$53 | 15-30 minutes |
| Combined | ~$100+ | Varies |
Guides in This Section
Deployment Guide
Comprehensive guide covering initial deployment, PR-based workflows, environment promotion, and rollback procedures.
Terrateam Workflow
Deep dive into how Terrateam orchestrates deployments across our multi-repository architecture, including Lambda code deployment patterns.
Infrastructure Teardown
Automated cost optimization system with Slack ChatOps control for non-production environments.
Repository Migration
Reference documentation for the migration from monolithic repository to the Gruntwork two-repository pattern.
Cloudflare Access Setup
Configuring Zero Trust authentication for internal services using GitHub as the identity provider.
Emergency Procedures
For production incidents, see the Rollback Procedures section of the Deployment Guide.
Emergency Contacts:
| Issue | Contact | Method |
|---|---|---|
| Production outage | On-call engineer | PagerDuty |
| Infrastructure issues | Infrastructure team | Slack #infra-alerts |
| AWS account issues | AWS Support | Support Console |