Repository navigation
Home
DRomothewriter edited this page Nov 26, 2026
·
2 revisions
Infraestructura como Código (Terraform) y orquestación de producción (Docker Compose + Nginx + Certbot) para desplegar Orbit en AWS de forma reproducible, segura y costo-eficiente.
Note
Toda la configuración refleja los archivos .tf, docker/, tests/ y .github/workflows/ reales en DRomothewriter/Orbit-IaC.
| Capa | Tecnología | Configuración Real | Propósito |
|---|---|---|---|
| IaC | Terraform |
>= 1.5.0, hashicorp/aws ~> 6.73
|
Provisionamiento declarativo en us-east-2 (+ alias us-east-1 para ACM) |
| Remote State | S3 + DynamoDB |
orbit-terraform-state-us-east-2 / orbit-terraform-locks
|
Estado cifrado (AES256), versionado y bloqueo distribuido |
| Frontend Hosting | S3 Privado + CloudFront + OAC |
TLSv1.2_2021, 403/404 -> 200 /index.html
|
Distribución global HTTPS de la SPA Angular |
| Backend & SFU | EC2 Ubuntu 24.04 + Elastic IP |
t3.small, EBS gp3 30 GiB cifrado, IMDSv2 |
Host único con Docker Compose en network_mode: host
|
| Reverse Proxy & TLS | Nginx Alpine + Certbot | docker/nginx/conf.d/orbit.conf |
Terminación TLS 1.2/1.3, proxy HTTP/WSS y renovación automática |
| CI/CD & Registry | Amazon ECR + GitHub OIDC |
orbit-backend (scan_on_push), IAM OIDC |
Despliegues sin access keys estáticas vía AWS SSM |
| Pruebas & Seguridad |
terraform test + Node tests + TFLint + Trivy + Checkov + Snyk |
12 tests HCL + 6 suites workflow | Validación determinística sin costos AWS |
flowchart TB
USER["Usuarios (Browser)"]
R53["Route 53 (diego-romo-dev.com)"]
USER --> R53
R53 -->|"Alias A: orbit.diego-romo-dev.com"| CF["CloudFront + ACM (us-east-1) + OAC"]
CF --> S3FE["S3 Frontend Static (100% Privado)"]
R53 -->|"A: api.orbit.diego-romo-dev.com"| EIP["Elastic IP (MEDIASOUP_ANNOUNCED_IP)"]
EIP --> SG["Security Group (TCP 80/443, UDP 10000-10100)"]
subgraph EC2["EC2 Ubuntu 24.04 (t3.small, IMDSv2, SSM)"]
NGX["Nginx + Certbot (:80 / :443)"]
BE["orbit-backend (:3000 + UDP 10000-10100)"]
end
SG --> NGX
NGX --> BE
SG -->|"UDP Directo RTP/RTCP"| BE
BE --> S3M["S3 Media Storage (Public Read GET)"]
BE --> MONGO["MongoDB Atlas (/orbit)"]
GHA["GitHub Actions (OIDC)"] -->|"Push Image"| ECR["Amazon ECR (orbit-backend)"]
GHA -->|"SSM SendCommand"| EC2
GHA -->|"S3 Sync + Invalidation"| CF
ECR -->|"docker pull"| EC2
| Ruta | Responsabilidad |
|---|---|
versions.tf, providers.tf
|
Backend remoto S3/DynamoDB y proveedores AWS (us-east-2 y alias us-east-1) |
backend_resources.tf |
Bucket S3 de estado (prevent_destroy = true) y tabla DynamoDB de locks |
network.tf, security_groups.tf
|
Default VPC (sin costo de NAT Gateway) y firewall (TCP 80/443, UDP 10000-10100) |
ec2.tf, user_data.sh, iam.tf
|
Instancia Ubuntu 24.04, Elastic IP, bootstrap Docker/SSM y rol IAM (SSM/S3/ECR) |
frontend.tf, dns.tf, media_storage.tf
|
SPA privada en S3 + CloudFront OAC, Route 53 + ACM y bucket S3 de media |
cicd_oidc.tf |
Repositorio ECR (retención 5 imágenes) y federación OIDC para los 3 repos Orbit |
docker/ |
docker-compose.prod.yml, nginx/, scripts/init-ssl.sh, .env.production.template
|
tests/ |
infrastructure.tftest.hcl (12 tests con mock_provider) y security.workflows.test.js
|
- Architecture and Features — Decisiones clave (sin ALB/EKS), TLS, OIDC y escalado.
- Infrastructure and Resources — Inventario exacto de recursos AWS, puertos, variables y outputs.
-
DevSecOps and Workflows —
ci-dev.yml,security-main.yml,release.ymlydrift.yml. - Contributing and Local Workflow — Bootstrap de remote state, ramas y checklist pre-PR.
- Troubleshooting and Runbook — Drift, locks de DynamoDB, Let's Encrypt y excepciones de escaneo.
Inicio
Diseño e Infraestructura
DevSecOps y Operación
Ecosistema Orbit