# joshuaonaiwu/infra-state-platform architecture

> Architecture diagram of the GitHub repository joshuaonaiwu/infra-state-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joshuaonaiwu/infra-state-platform
- Repository: https://github.com/joshuaonaiwu/infra-state-platform

## Overview

This repository provides a Terraform state platform and its controlled delivery workflow. Engineers submit changes through GitHub; the documented workflow plans changes for pull requests and applies them after merges. Bootstrap provisions versioned, encrypted S3 state storage and DynamoDB locking; the infrastructure configuration uses the remote backend. GitHub OIDC supplies temporary AWS credentials through STS and an IAM role. Relationships below are based on the README; source excerpts were unavailable, so implementation-level details are not inferred.

Main entry points: [`.github/workflows/terraform.yml`](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml) (Terraform Workflow), [`infra/backend.tf`](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/infra/backend.tf) (Remote Backend Config), [`bootstrap/main.tf`](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf) (Backend Bootstrap), [`infra/main.tf`](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/infra/main.tf) (Infrastructure Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["Change Delivery"]
  node_workflow["Terraform Workflow<br/>[terraform.yml]"]
  node_plan["Terraform Plan<br/>[terraform.yml]"]
  node_apply["Terraform Apply<br/>[terraform.yml]"]
end

subgraph group_auth["AWS Authentication"]
  node_oidc["GitHub OIDC"]
  node_sts["AWS STS"]
  node_role{{"IAM Role<br/>[main.tf]"}}
end

subgraph group_backend["Terraform Backend"]
  node_bootstrap["Backend Bootstrap<br/>[main.tf]"]
  node_s3[("S3 State Storage<br/>[main.tf]")]
  node_dynamodb[("DynamoDB Locking<br/>[main.tf]")]
  node_backend_config["Remote Backend Config<br/>[backend.tf]"]
end

subgraph group_infrastructure["Managed Infrastructure"]
  node_infra["Infrastructure Config<br/>[main.tf]"]
end

node_engineer(("Engineer"))
node_github["GitHub Repository"]
node_terraform["Terraform"]

node_engineer -->|"opens pull request"| node_github
node_github -->|"triggers workflow"| node_workflow
node_workflow -->|"runs on pull request"| node_plan
node_workflow -->|"runs after merge"| node_apply
node_plan -->|"runs plan"| node_terraform
node_apply -->|"runs apply"| node_terraform
node_workflow -->|"requests token"| node_oidc
node_oidc -->|"federates with"| node_sts
node_sts -->|"assumes role"| node_role
node_bootstrap -->|"provisions"| node_s3
node_bootstrap -->|"provisions"| node_dynamodb
node_terraform -->|"initializes backend"| node_backend_config
node_backend_config -->|"stores state"| node_s3
node_backend_config -->|"locks state"| node_dynamodb
node_terraform -->|"plans and applies"| node_infra

click node_workflow "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml"
click node_plan "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml"
click node_apply "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml"
click node_role "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf"
click node_bootstrap "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf"
click node_s3 "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf"
click node_dynamodb "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf"
click node_backend_config "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/infra/backend.tf"
click node_infra "https://github.com/joshuaonaiwu/infra-state-platform/blob/main/infra/main.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_workflow,node_plan,node_apply toneBlue
class node_oidc,node_sts,node_role toneAmber
class node_bootstrap,node_s3,node_dynamodb,node_backend_config toneMint
class node_infra toneRose
class node_engineer,node_github,node_terraform toneIndigo
```

## Components

### Change Delivery

- [Terraform Workflow](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml): `.github/workflows/terraform.yml`
- [Terraform Plan](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml): `.github/workflows/terraform.yml`
- [Terraform Apply](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/.github/workflows/terraform.yml): `.github/workflows/terraform.yml`

### AWS Authentication

- **GitHub OIDC**
- **AWS STS**
- [IAM Role](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf): `bootstrap/main.tf`

### Terraform Backend

- [Backend Bootstrap](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf): `bootstrap/main.tf`
- [S3 State Storage](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf): `bootstrap/main.tf`
- [DynamoDB Locking](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/bootstrap/main.tf): `bootstrap/main.tf`
- [Remote Backend Config](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/infra/backend.tf): `infra/backend.tf`

### Managed Infrastructure

- [Infrastructure Config](https://github.com/joshuaonaiwu/infra-state-platform/blob/main/infra/main.tf): `infra/main.tf`

### Other components

- **Engineer**
- **GitHub Repository**
- **Terraform**

## Connections

- Engineer → GitHub Repository: opens pull request (evidence: `README.md`)
- GitHub Repository → Terraform Workflow: triggers workflow (evidence: `README.md`)
- Terraform Workflow → Terraform Plan: runs on pull request (evidence: `README.md`)
- Terraform Workflow → Terraform Apply: runs after merge (evidence: `README.md`)
- Terraform Plan → Terraform: runs plan (evidence: `README.md`)
- Terraform Apply → Terraform: runs apply (evidence: `README.md`)
- Terraform Workflow → GitHub OIDC: requests token (evidence: `README.md`)
- GitHub OIDC → AWS STS: federates with (evidence: `README.md`)
- AWS STS → IAM Role: assumes role (evidence: `README.md`)
- Backend Bootstrap → S3 State Storage: provisions (evidence: `README.md`)
- Backend Bootstrap → DynamoDB Locking: provisions (evidence: `README.md`)
- Terraform → Remote Backend Config: initializes backend (evidence: `README.md`)
- Remote Backend Config → S3 State Storage: stores state (evidence: `README.md`)
- Remote Backend Config → DynamoDB Locking: locks state (evidence: `README.md`)
- Terraform → Infrastructure Config: plans and applies (evidence: `README.md`)
