# reticent93/aws_vpc architecture

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

- Interactive diagram: https://gitdiagram.com/reticent93/aws_vpc
- Repository: https://github.com/reticent93/aws_vpc

## Overview

This repository provisions AWS networking and a containerized FastAPI service, then deploys it through GitHub Actions using OIDC. The principal user path is Internet traffic through the ALB to an ECS Fargate task and its health endpoint. Terraform also provisions two VPCs and peering, while the documented deployment builds and pushes an image before applying infrastructure changes. Infrastructure-module internals were not sampled, so relationships not described in the README are omitted; the graph reflects documented connections rather than inferred Terraform wiring.

Main entry points: [`main.tf`](https://github.com/reticent93/aws_vpc/blob/main/main.tf) (Terraform root), [`modules/ecs/main.tf`](https://github.com/reticent93/aws_vpc/blob/main/modules/ecs/main.tf) (ECS Fargate service), [`.github/workflows/deploy.yml`](https://github.com/reticent93/aws_vpc/blob/main/.github/workflows/deploy.yml) (GitHub Actions deploy), [`modules/alb/main.tf`](https://github.com/reticent93/aws_vpc/blob/main/modules/alb/main.tf) (Application Load Balancer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_api["FastAPI endpoints<br/>[main.py]"]
end

subgraph group_runtime["Service Runtime"]
  node_alb["Application Load Balancer<br/>[main.tf]"]
  node_ecs["ECS Fargate service<br/>[main.tf]"]
  node_ecr["Container registry<br/>[main.tf]"]
  node_logs[("CloudWatch Logs<br/>[main.tf]")]
end

subgraph group_network["AWS Networking"]
  node_vpc["VPCs<br/>[main.tf]"]
  node_subnets["Subnets<br/>[main.tf]"]
  node_peering["VPC peering<br/>[main.tf]"]
end

subgraph group_operations["Provisioning and Deployment"]
  node_terraform["Terraform root<br/>[main.tf]"]
  node_iam["IAM roles<br/>[main.tf]"]
  node_s3module[("S3 module<br/>[main.tf]")]
  node_state[("Terraform state bucket")]
  node_workflow["GitHub Actions deploy<br/>[deploy.yml]"]
  node_oidc["GitHub OIDC<br/>[github_actions.tf]"]
  node_docker["Docker image build"]
end

node_user(("Internet client"))

node_user -->|"sends HTTP"| node_alb
node_alb -->|"routes traffic"| node_ecs
node_ecs -->|"runs container"| node_api
node_ecs -->|"pulls image"| node_ecr
node_ecs -->|"writes logs"| node_logs
node_terraform -->|"provisions"| node_vpc
node_terraform -->|"provisions"| node_subnets
node_terraform -->|"provisions"| node_peering
node_terraform -->|"provisions"| node_alb
node_terraform -->|"provisions"| node_ecs
node_terraform -->|"provisions"| node_ecr
node_terraform -->|"provisions"| node_iam
node_terraform -->|"provisions"| node_s3module
node_terraform -->|"stores state"| node_state
node_workflow -->|"assumes role"| node_oidc
node_workflow -->|"builds image"| node_docker
node_workflow -->|"pushes image"| node_ecr
node_workflow -->|"applies changes"| node_terraform

click node_api "https://github.com/reticent93/aws_vpc/blob/main/app/main.py"
click node_alb "https://github.com/reticent93/aws_vpc/blob/main/modules/alb/main.tf"
click node_ecs "https://github.com/reticent93/aws_vpc/blob/main/modules/ecs/main.tf"
click node_ecr "https://github.com/reticent93/aws_vpc/blob/main/modules/ecr/main.tf"
click node_logs "https://github.com/reticent93/aws_vpc/blob/main/modules/ecs/main.tf"
click node_vpc "https://github.com/reticent93/aws_vpc/blob/main/modules/vpc/main.tf"
click node_subnets "https://github.com/reticent93/aws_vpc/blob/main/modules/subnets/main.tf"
click node_peering "https://github.com/reticent93/aws_vpc/blob/main/modules/vpc_peering/main.tf"
click node_terraform "https://github.com/reticent93/aws_vpc/blob/main/main.tf"
click node_iam "https://github.com/reticent93/aws_vpc/blob/main/modules/iam/main.tf"
click node_s3module "https://github.com/reticent93/aws_vpc/blob/main/modules/s3/main.tf"
click node_workflow "https://github.com/reticent93/aws_vpc/blob/main/.github/workflows/deploy.yml"
click node_oidc "https://github.com/reticent93/aws_vpc/blob/main/github_actions.tf"
click node_docker "https://github.com/reticent93/aws_vpc/blob/main/app/Dockerfile"

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_api,node_user toneBlue
class node_alb,node_ecs,node_ecr,node_logs toneAmber
class node_vpc,node_subnets,node_peering toneMint
class node_terraform,node_iam,node_s3module,node_state,node_workflow,node_oidc,node_docker toneRose
```

## Components

### Application

- [FastAPI endpoints](https://github.com/reticent93/aws_vpc/blob/main/app/main.py): `app/main.py`

### Service Runtime

- [Application Load Balancer](https://github.com/reticent93/aws_vpc/blob/main/modules/alb/main.tf): `modules/alb/main.tf`
- [ECS Fargate service](https://github.com/reticent93/aws_vpc/blob/main/modules/ecs/main.tf): `modules/ecs/main.tf`
- [Container registry](https://github.com/reticent93/aws_vpc/blob/main/modules/ecr/main.tf): `modules/ecr/main.tf`
- [CloudWatch Logs](https://github.com/reticent93/aws_vpc/blob/main/modules/ecs/main.tf): `modules/ecs/main.tf`

### AWS Networking

- [VPCs](https://github.com/reticent93/aws_vpc/blob/main/modules/vpc/main.tf): `modules/vpc/main.tf`
- [Subnets](https://github.com/reticent93/aws_vpc/blob/main/modules/subnets/main.tf): `modules/subnets/main.tf`
- [VPC peering](https://github.com/reticent93/aws_vpc/blob/main/modules/vpc_peering/main.tf): `modules/vpc_peering/main.tf`

### Provisioning and Deployment

- [Terraform root](https://github.com/reticent93/aws_vpc/blob/main/main.tf): `main.tf`
- [IAM roles](https://github.com/reticent93/aws_vpc/blob/main/modules/iam/main.tf): `modules/iam/main.tf`
- [S3 module](https://github.com/reticent93/aws_vpc/blob/main/modules/s3/main.tf): `modules/s3/main.tf`
- **Terraform state bucket**
- [GitHub Actions deploy](https://github.com/reticent93/aws_vpc/blob/main/.github/workflows/deploy.yml): `.github/workflows/deploy.yml`
- [GitHub OIDC](https://github.com/reticent93/aws_vpc/blob/main/github_actions.tf): `github_actions.tf`
- [Docker image build](https://github.com/reticent93/aws_vpc/blob/main/app/Dockerfile): `app/Dockerfile`

### Other components

- **Internet client**

## Connections

- Internet client → Application Load Balancer: sends HTTP (evidence: `README.md`)
- Application Load Balancer → ECS Fargate service: routes traffic (evidence: `README.md`)
- ECS Fargate service → FastAPI endpoints: runs container (evidence: `README.md`)
- ECS Fargate service → Container registry: pulls image (evidence: `README.md`)
- ECS Fargate service → CloudWatch Logs: writes logs (evidence: `README.md`)
- Terraform root → VPCs: provisions (evidence: `README.md`)
- Terraform root → Subnets: provisions (evidence: `README.md`)
- Terraform root → VPC peering: provisions (evidence: `README.md`)
- Terraform root → Application Load Balancer: provisions (evidence: `README.md`)
- Terraform root → ECS Fargate service: provisions (evidence: `README.md`)
- Terraform root → Container registry: provisions (evidence: `README.md`)
- Terraform root → IAM roles: provisions (evidence: `README.md`)
- Terraform root → S3 module: provisions (evidence: `README.md`)
- Terraform root → Terraform state bucket: stores state (evidence: `README.md`)
- GitHub Actions deploy → GitHub OIDC: assumes role (evidence: `README.md`)
- GitHub Actions deploy → Docker image build: builds image (evidence: `README.md`)
- GitHub Actions deploy → Container registry: pushes image (evidence: `README.md`)
- GitHub Actions deploy → Terraform root: applies changes (evidence: `README.md`)
