# cisco-open/forge architecture

> Architecture diagram of the GitHub repository cisco-open/forge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cisco-open/forge
- Repository: https://github.com/cisco-open/forge

## Overview

1. **What this repo is**
   ForgeMT is an infrastructure-as-code platform for running GitHub Actions runners on AWS. The repository is mostly OpenTofu/Terraform modules plus Terragrunt examples, with a few helper Lambdas, container images, and automation scripts.

2. **Primary architectural split: control plane vs tenant plane**
   The README’s core model is a **control plane** that provisions and manages the platform, and a **tenant plane** that executes ephemeral CI/CD jobs. The control plane owns lifecycle, scaling, and trust relationships; tenants consume runners through GitHub workflows and assume short-lived AWS roles via OIDC.

3. **`modules/platform/forge_runners` is the central orchestration layer**
   This is the main platform module that assembles runner capabilities end-to-end. It wires together EC2 runners, ARC/Kubernetes runners, GitHub webhook relay, GitHub App management, trust validation, job log handling, SSM, service catalog, and supporting IAM/resources. If you are drawing the core architecture, this is the hub.

4. **Two runner execution paths**
   ForgeMT supports:
   - **EC2 runners** for full VM control, custom AMIs, and per-tenant sandboxing.
   - **ARC/EKS runners** for containerized execution using Actions Runner Controller, Karpenter, and Kubernetes namespaces.
   These are separate runtime paths but share the same control-plane patterns: automation, ephemeral provisioning, and AWS identity boundaries.

5. **EC2 runner subsystem**
   `modules/platform/ec2_deployment` and `modules/platform/forge_runners/ec2_runners.tf` cover EC2 runner provisioning and lifecycle. The module includes launch/template files, security groups, roles, AMI handling, and Lambda-driven automation for updating runner AMIs and tags. This path is where custom instance shapes and OS-level control live.

6. **EKS/ARC runner subsystem**
   `modules/core/arc` and `modules/infra/eks` provide the Kubernetes side of the platform. The EKS module provisions cluster-level infrastructure, add-ons, node classes/pools, and Calico-related networking. The ARC module deploys runner scale sets and controller pieces via Helm and generated manifests, bridging GitHub job demand to Kubernetes pods.

7. **Foundational AWS infrastructure modules**
   `modules/infra` contains reusable AWS building blocks: EKS, ECR, S3 storage, IAM/service-linked roles, AMI sharing/policy, CloudFormation, opt-in regions, and Forge subscription scaffolding. These are the base resources that the platform and integrations depend on before runners can be deployed.

8. **Integration modules connect the platform to external systems**
   `modules/integrations` handles non-runner services such as:
   - **GitHub webhook relay** source/destination and receiver Lambdas
   - **Splunk** observability and cloud data manager integrations
   - **AWS billing/export pipelines**
   - **Teleport** identity/access integration
   - **Secrets and cross-account trust** plumbing
   These modules usually bridge AWS services, GitHub, and third-party SaaS rather than hosting workloads themselves.

9. **GitHub App and webhook lifecycle are first-class**
   The repo includes a Dockerized `forge-github-app-register` utility and GitHub App manifest assets. The platform also includes modules and Lambdas for validating trust, relaying webhooks, cleaning up locks, and managing runner groups. This indicates GitHub is not just a consumer; it is part of the control-plane workflow.

10. **Observability and governance are built into the platform**
   Splunk-oriented modules and dashboards are a major subsystem: runner logs, CloudWatch pipelines, S3/Kinesis/Firehose/Lambda log shipping, and dashboards for EC2, K8s, Lambda, SQS, and billing. Governance also shows up in trust validation, secrets handling, and policy modules.

11. **Terragrunt examples define real deployment topologies**
   `examples/` is not sample code only; it is the operational blueprint for deployments. It shows layered configuration for:
   - global settings
   - environment-wide settings
   - region-wide settings
   - VPC/tenant-specific settings
   This is important for the architecture diagram because the repo uses Terragrunt inheritance to compose real environments from the module stack.

12. **Operational tooling around the IaC**
   The repo also contains CI and maintenance tooling: GitHub Actions workflows, pre-commit/lint configs, Renovate, helper scripts for tenant migration, EKS reinstall, GitHub App secret updates, and Terraform docs generation. These are supporting automation boundaries around the platform, not part of runtime runner execution.

13. **How the main data/control flows work**
   The high-level flow is: repository configuration → Terragrunt/OpenTofu applies modules → AWS resources and Lambdas are provisioned → GitHub App/webhooks authenticate and route events → runner capacity is created on EC2 or EKS → jobs execute with OIDC-based AWS access → logs/metrics/traces are shipped to observability backends. The control plane continuously reconciles and updates these pieces.

14. **What to emphasize in an architecture diagram**
   Show four layers: **repo/automation**, **control-plane modules**, **AWS runtime infrastructure**, and **tenant job execution**. Then draw external edges to **GitHub**, **AWS services**, and optional **Splunk/Teleport** integrations. The strongest boundary is between platform-managed infrastructure and tenant-owned CI workloads.

Main entry points: [`modules/platform/forge_runners`](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners) (Forge Runners), [`modules/platform/forge_runners/github_webhook_relay`](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_webhook_relay) (Webhook Relay), [`modules/integrations`](https://github.com/cisco-open/forge/tree/main/modules/integrations) (Splunk Stack), [`examples`](https://github.com/cisco-open/forge/tree/main/examples) (Examples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_repo["Repo & automation"]
  node_repo_readme["README<br/>docs<br/>[README.md]"]
  node_repo_examples["Examples<br/>terragrunt blueprints"]
  node_repo_workflows["CI Workflows<br/>github actions<br/>[workflows]"]
  node_repo_scripts["Ops Scripts<br/>maintenance scripts"]
  node_docker_app_register["GitHub App Tool<br/>container utility"]
end

subgraph group_grp_control["Control plane"]
  node_platform_forge_runners["Forge Runners<br/>control plane"]
  node_platform_ec2_deployment["EC2 Deploy<br/>ec2 control"]
  node_platform_arc_deployment["ARC Deploy<br/>k8s control"]
  node_platform_trust["Trust Validator<br/>lambda guard"]
  node_platform_job_logs["Job Logs<br/>log pipeline"]
  node_platform_webhook["Webhook Relay<br/>event bridge"]
  node_platform_runner_group["Runner Group<br/>github automation"]
  node_platform_global_lock["Global Lock<br/>coordination lambda"]
  node_platform_redrive["Redrive<br/>queue recovery"]
  node_platform_catalog["Service Catalog<br/>platform service<br/>[service_catalog.tf]"]
end

subgraph group_grp_aws["AWS infrastructure"]
  node_aws_eks["EKS<br/>cluster infra"]
  node_aws_core["Core Infra<br/>aws foundations"]
  node_arc_core["ARC Core<br/>runner k8s"]
end

subgraph group_grp_integrations["Integrations & observability"]
  node_integrations_github["GitHub Relay<br/>github integration"]
  node_integrations_splunk["Splunk Stack<br/>observability"]
  node_integrations_teleport["Teleport<br/>identity bridge"]
end

subgraph group_grp_tenant["Tenant runtime"]
  node_tenant_examples["Tenant Blueprint<br/>terragrunt tenant"]
  node_tenant_arc["ARC Runners<br/>tenant runtime<br/>[arc_runners.tf]"]
  node_tenant_ec2["EC2 Runners<br/>tenant runtime<br/>[ec2_runners.tf]"]
end

node_repo_readme -->|"describes"| node_platform_forge_runners
node_repo_examples -->|"composes"| node_aws_core
node_repo_examples -->|"deploys"| node_platform_forge_runners
node_repo_examples -->|"defines"| node_tenant_examples
node_repo_workflows -->|"builds"| node_docker_app_register
node_repo_workflows -->|"validates"| node_repo_examples
node_repo_scripts -.->|"operates"| node_platform_forge_runners
node_docker_app_register -->|"registers"| node_platform_webhook
node_platform_forge_runners -->|"includes"| node_platform_ec2_deployment
node_platform_forge_runners -->|"includes"| node_platform_arc_deployment
node_platform_forge_runners -->|"includes"| node_platform_trust
node_platform_forge_runners -->|"includes"| node_platform_job_logs
node_platform_forge_runners -->|"includes"| node_platform_webhook
node_platform_forge_runners -->|"includes"| node_platform_runner_group
node_platform_forge_runners -->|"includes"| node_platform_global_lock
node_platform_forge_runners -->|"includes"| node_platform_redrive
node_platform_forge_runners -->|"publishes"| node_platform_catalog
node_platform_ec2_deployment -->|"depends on"| node_aws_core
node_platform_arc_deployment -->|"depends on"| node_aws_eks
node_aws_eks -->|"hosts"| node_arc_core
node_aws_core -.->|"feeds"| node_integrations_splunk
node_integrations_github -->|"connects"| node_platform_webhook
node_integrations_splunk -->|"ingests"| node_platform_job_logs
node_integrations_splunk -.->|"observes"| node_tenant_ec2
node_integrations_splunk -.->|"observes"| node_tenant_arc
node_integrations_teleport -->|"secures"| node_platform_forge_runners
node_tenant_examples -->|"configures"| node_tenant_ec2
node_tenant_examples -->|"configures"| node_tenant_arc
node_platform_webhook -->|"triggers"| node_tenant_ec2
node_platform_webhook -->|"triggers"| node_tenant_arc
node_platform_trust -.->|"validates"| node_aws_core

click node_repo_readme "https://github.com/cisco-open/forge/blob/main/README.md"
click node_repo_examples "https://github.com/cisco-open/forge/tree/main/examples"
click node_repo_workflows "https://github.com/cisco-open/forge/blob/main/.github/workflows"
click node_repo_scripts "https://github.com/cisco-open/forge/tree/main/scripts"
click node_docker_app_register "https://github.com/cisco-open/forge/blob/main/.docker/forge-github-app-register"
click node_platform_forge_runners "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners"
click node_platform_ec2_deployment "https://github.com/cisco-open/forge/tree/main/modules/platform/ec2_deployment"
click node_platform_arc_deployment "https://github.com/cisco-open/forge/tree/main/modules/platform/arc_deployment"
click node_platform_trust "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/forge_trust_validator"
click node_platform_job_logs "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_actions_job_logs"
click node_platform_webhook "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_webhook_relay"
click node_platform_runner_group "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_app_runner_group"
click node_platform_global_lock "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_global_lock"
click node_platform_redrive "https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/redrive_deadletter"
click node_platform_catalog "https://github.com/cisco-open/forge/blob/main/modules/platform/forge_runners/service_catalog.tf"
click node_aws_eks "https://github.com/cisco-open/forge/tree/main/modules/infra/eks"
click node_aws_core "https://github.com/cisco-open/forge/tree/main/modules/infra"
click node_arc_core "https://github.com/cisco-open/forge/tree/main/modules/core/arc"
click node_integrations_github "https://github.com/cisco-open/forge/tree/main/modules/integrations/github_webhook_relay_source"
click node_integrations_splunk "https://github.com/cisco-open/forge/tree/main/modules/integrations"
click node_integrations_teleport "https://github.com/cisco-open/forge/tree/main/modules/integrations/teleport"
click node_tenant_examples "https://github.com/cisco-open/forge/tree/main/examples/deployments/forge-tenant"
click node_tenant_arc "https://github.com/cisco-open/forge/blob/main/modules/platform/forge_runners/arc_runners.tf"
click node_tenant_ec2 "https://github.com/cisco-open/forge/blob/main/modules/platform/forge_runners/ec2_runners.tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_repo_readme,node_repo_examples,node_repo_workflows,node_repo_scripts,node_docker_app_register toneBlue
class node_platform_forge_runners,node_platform_ec2_deployment,node_platform_arc_deployment,node_platform_trust,node_platform_job_logs,node_platform_webhook,node_platform_runner_group,node_platform_global_lock,node_platform_redrive,node_platform_catalog toneAmber
class node_aws_eks,node_aws_core,node_arc_core toneMint
class node_integrations_github,node_integrations_splunk,node_integrations_teleport toneRose
class node_tenant_examples,node_tenant_arc,node_tenant_ec2 toneIndigo
```

## Components

### Repo & automation

Documentation, examples, CI workflows, build helpers, and maintenance scripts that drive platform changes.

- [README](https://github.com/cisco-open/forge/blob/main/README.md): docs · Entry-point documentation for the platform architecture and operating model. · `README.md`
- [Examples](https://github.com/cisco-open/forge/tree/main/examples): terragrunt blueprints · Real deployment topologies composed from layered Terragrunt configuration. · `examples`
- [CI Workflows](https://github.com/cisco-open/forge/blob/main/.github/workflows): github actions · Repository automation for building images and validating local changes. · `.github/workflows`
- [Ops Scripts](https://github.com/cisco-open/forge/tree/main/scripts): maintenance scripts · Helper scripts for migrations, EKS reinstall, secret rotation, and docs generation. · `scripts`
- [GitHub App Tool](https://github.com/cisco-open/forge/blob/main/.docker/forge-github-app-register): container utility · Dockerized utility for registering and packaging the GitHub App. · `.docker/forge-github-app-register`

### Control plane

Top-level orchestration modules that assemble runner lifecycle, identity, logs, and GitHub integration.

- [Forge Runners](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners): control plane · Central orchestration module that wires runner paths, GitHub lifecycle, trust, logs, and platform services. · `modules/platform/forge_runners`
- [EC2 Deploy](https://github.com/cisco-open/forge/tree/main/modules/platform/ec2_deployment): ec2 control · EC2 runner provisioning, AMI handling, security groups, and Lambda-driven updates. · `modules/platform/ec2_deployment`
- [ARC Deploy](https://github.com/cisco-open/forge/tree/main/modules/platform/arc_deployment): k8s control · Platform wrapper for Actions Runner Controller deployment on Kubernetes. · `modules/platform/arc_deployment`
- [Trust Validator](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/forge_trust_validator): lambda guard · Validates platform trust relationships and related GitHub/AWS assumptions. · `modules/platform/forge_runners/forge_trust_validator`
- [Job Logs](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_actions_job_logs): log pipeline · Archives and dispatches GitHub Actions job logs into storage and downstream processing. · `modules/platform/forge_runners/github_actions_job_logs`
- [Webhook Relay](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_webhook_relay): event bridge · Receives and relays GitHub webhook events into the control plane. · `modules/platform/forge_runners/github_webhook_relay`
- [Runner Group](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_app_runner_group): github automation · Creates and manages GitHub runner group metadata for platform tenants. · `modules/platform/forge_runners/github_app_runner_group`
- [Global Lock](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/github_global_lock): coordination lambda · Cleans up and coordinates global lock state used by runner operations. · `modules/platform/forge_runners/github_global_lock`
- [Redrive](https://github.com/cisco-open/forge/tree/main/modules/platform/forge_runners/redrive_deadletter): queue recovery · Moves failed work from dead-letter paths back into processing flows. · `modules/platform/forge_runners/redrive_deadletter`
- [Service Catalog](https://github.com/cisco-open/forge/blob/main/modules/platform/forge_runners/service_catalog.tf): platform service · Publishes platform-managed resources and access surfaces for consumers. · `modules/platform/forge_runners/service_catalog.tf`

### AWS infrastructure

Reusable infrastructure modules for EKS, storage, ECR, IAM-style foundations, and regional AWS resources.

- [EKS](https://github.com/cisco-open/forge/tree/main/modules/infra/eks): cluster infra · Reusable EKS cluster provisioning with add-ons, node pools, and Calico networking. · `modules/infra/eks`
- [Core Infra](https://github.com/cisco-open/forge/tree/main/modules/infra): aws foundations · Base AWS building blocks such as ECR, storage, CloudFormation, roles, AMI policy/sharing, opt-in regions, and subscription scaffolding. · `modules/infra`
- [ARC Core](https://github.com/cisco-open/forge/tree/main/modules/core/arc): runner k8s · Controller-side Kubernetes plumbing for Actions Runner Controller and node integration. · `modules/core/arc`

### Integrations & observability

External-system bridges for GitHub, Splunk, Teleport, and related governance/telemetry pipelines.

- [GitHub Relay](https://github.com/cisco-open/forge/tree/main/modules/integrations/github_webhook_relay_source): github integration · Source and destination webhook relay modules plus receiver Lambdas for external callbacks. · `modules/integrations/github_webhook_relay_source`
- [Splunk Stack](https://github.com/cisco-open/forge/tree/main/modules/integrations): observability · CloudWatch, Firehose, Kinesis, S3, dashboards, and Splunk Cloud/Observability integrations. · `modules/integrations`
- [Teleport](https://github.com/cisco-open/forge/tree/main/modules/integrations/teleport): identity bridge · Teleport access and tenant integration for privileged entry and identity boundaries. · `modules/integrations/teleport`

### Tenant runtime

Ephemeral CI execution paths and tenant-specific deployment composition.

- [Tenant Blueprint](https://github.com/cisco-open/forge/tree/main/examples/deployments/forge-tenant): terragrunt tenant · Tenant-specific layered configuration showing how one tenant consumes the platform. · `examples/deployments/forge-tenant`
- [ARC Runners](https://github.com/cisco-open/forge/blob/main/modules/platform/forge_runners/arc_runners.tf): tenant runtime · Ephemeral containerized runner path executed on Kubernetes via ARC. · `modules/platform/forge_runners/arc_runners.tf`
- [EC2 Runners](https://github.com/cisco-open/forge/blob/main/modules/platform/forge_runners/ec2_runners.tf): tenant runtime · Ephemeral VM-based runner path executed on AWS EC2. · `modules/platform/forge_runners/ec2_runners.tf`

## Connections

- README → Forge Runners: describes · Documentation centers the main orchestration module and operating model.
- Examples → Core Infra: composes · Terragrunt blueprints layer regional and environment settings over reusable AWS modules.
- Examples → Forge Runners: deploys · Deployment examples instantiate the platform control plane.
- Examples → Tenant Blueprint: defines · Tenant examples show per-tenant overlays and runner settings.
- CI Workflows → GitHub App Tool: builds · CI builds the GitHub App registration image.
- CI Workflows → Examples: validates · Automation checks repository changes against example deployment patterns.
- Ops Scripts → Forge Runners: operates · Maintenance scripts update secrets, migrate tenants, and refresh platform docs.
- GitHub App Tool → Webhook Relay: registers · Container utility prepares GitHub App assets used by webhook-oriented automation.
- Forge Runners → EC2 Deploy: includes · The main platform module wires the EC2 runner execution path.
- Forge Runners → ARC Deploy: includes · The main platform module wires the ARC/Kubernetes execution path.
- Forge Runners → Trust Validator: includes · Trust validation is part of the control plane.
- Forge Runners → Job Logs: includes · Job log handling is managed as a first-class platform concern.
- Forge Runners → Webhook Relay: includes · GitHub event intake is part of the orchestration layer.
- Forge Runners → Runner Group: includes · Runner-group automation belongs to the control plane.
- Forge Runners → Global Lock: includes · Global lock cleanup and coordination are platform-managed.
- Forge Runners → Redrive: includes · Dead-letter recovery is handled centrally.
- Forge Runners → Service Catalog: publishes · The platform exposes consumable services and resources.
- EC2 Deploy → Core Infra: depends on · EC2 runner deployment consumes base AWS primitives.
- ARC Deploy → EKS: depends on · ARC deployment requires EKS cluster infrastructure.
- EKS → ARC Core: hosts · Kubernetes infrastructure hosts the ARC controller and runner scale sets.
- Core Infra → Splunk Stack: feeds · Foundational AWS resources provide data and access paths for telemetry integrations.
- GitHub Relay → Webhook Relay: connects · GitHub webhook relay transports events into the platform.
- Splunk Stack → Job Logs: ingests · Observability stack receives runner and job log data.
- Splunk Stack → EC2 Runners: observes · Dashboards and pipelines cover EC2 runner behavior and resource usage.
- Splunk Stack → ARC Runners: observes · Dashboards and pipelines cover Kubernetes runner behavior and resource usage.
- Teleport → Forge Runners: secures · Teleport provides access and identity integration around the platform.
- Tenant Blueprint → EC2 Runners: configures · Tenant overlays drive the EC2-based runner path.
- Tenant Blueprint → ARC Runners: configures · Tenant overlays can also target the ARC-based runner path.
- Webhook Relay → EC2 Runners: triggers · Webhook events can fan out into VM-based ephemeral runners.
- Webhook Relay → ARC Runners: triggers · Webhook events can fan out into Kubernetes-based ephemeral runners.
- Trust Validator → Core Infra: validates · Trust validation governs IAM and cross-account assumptions.
