# DevOps Reference [← Home](README.md) · [Architecture](Architecture.md) · [Operations](Operations.md) · [Roadmap](Roadmap.md) ## AWS resources (eu-west-1) | Resource | Name/ID | Purpose | |----------|---------|---------| | Lambda | `tinqs-ci-dispatch` | Webhook handler + Spot launcher | | DynamoDB | `tinqs-ci-runs` | Run tracking (repo, run_id, instance_id, status) | | AMI | `tinqs-ci-runner-v2` (ami-00a129385002e4de9) | Pre-baked runner (Go, Node, Docker, act_runner) | | Security Group | sg-030bf74b43d3faac7 | Runner SG (outbound HTTPS) | | Subnet | subnet-04b5aeec9bfc4ec2c | Default VPC subnet | | Instance Profile | `tinqs-ci-runner` → role `tinqs-git-task` | Runner IAM role (S3, ECR, SSM) | | CloudWatch | /aws/lambda/tinqs-ci-dispatch | Dispatcher logs | | API Gateway | `q4ohxovfr8…/webhook` | Receives the per-repo Gitea push webhook | ### Platform host (NOT CI — context) | Resource | Name/ID | Purpose | |----------|---------|---------| | EC2 | `tinqs-prod-gitea` (i-0d085288f467083e0, t3.medium) | Runs tinqs.com as a single `docker` Gitea container | | ALB | `tinqs-git` | Fronts the platform | | ECR | `tinqs-git:latest` | Platform image (built by `build.yml` → CodeBuild) | | RDS | `tinqs-prod` (PostgreSQL) | Platform DB | The platform mounts host `/data`; `GITEA_CUSTOM=/data/gitea`, so **custom templates live at `/data/gitea/templates/`**. Template-only changes deploy here via SSM — see [Operations](Operations.md). ### Retired resources | Resource | When / why | |----------|------------| | ECS Cluster `tinqs-git` | Deleted **2026-06-05** — platform moved to the `tinqs-prod-gitea` EC2 box | | EFS `tinqs-git-repos` | Retired in the 2026-06-05 EC2 migration (repos now on instance `/data`) | | Lambda `tinqs-ci-exec` | Deleted **26 May 2026** — never ran a build; deploy jobs go through Spot now | | CloudWatch `/aws/lambda/tinqs-ci-exec`, `/ecs/tinqs-runner` | Log groups for the above / the Fargate era | | Fargate runner service | Scaled to 0 then removed | ## Webhook flow ``` Gitea (tinqs.com) └─ per-repo webhook on push └─ POST https:///webhook └─ Lambda tinqs-ci-dispatch ├─ Fetch .gitea/workflows/*.yml via Gitea API ├─ Evaluate triggers (branch + path filters) ├─ For each matched workflow: │ ├─ Read runs-on label │ └─ RunInstances (Spot, ephemeral) [host → skipped] └─ Track in DynamoDB ``` ## Spot instance lifecycle ``` 1. Lambda calls RunInstances (Spot, InstanceInitiatedShutdownBehavior=terminate) 2. User-data runs: a. Configure git auth (url.insteadOf with GITEA_TOKEN) b. act_runner register --ephemeral --labels