# nishi-panchal/cicd-terraform-eks architecture

> Architecture diagram of the GitHub repository nishi-panchal/cicd-terraform-eks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nishi-panchal/cicd-terraform-eks
- Repository: https://github.com/nishi-panchal/cicd-terraform-eks

## Overview

This repository demonstrates deploying a small Next.js application to Amazon EKS: Terraform provisions remote state and AWS infrastructure, and a GitHub Actions workflow is triggered by a push to main. The README documents ECR, EKS, and the Kubernetes deployment, but the workflow, Terraform, Docker, and Kubernetes source contents were not sampled; their internal wiring is therefore shown only where the README supports it, with unverified links dashed. The application page itself is a simple greeting.

Main entry points: [`terraform/main.tf`](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/main.tf) (Infrastructure configuration), [`.github/workflows/deploy.yml`](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/.github/workflows/deploy.yml) (GitHub Actions), [`terraform/eks.tf`](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/eks.tf) (EKS cluster), [`terraform/bootstrap/main.tf`](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/bootstrap/main.tf) (State bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Web application"]
  node_nextpage["Home page<br/>[page.js]"]
  node_rootlayout["Root layout<br/>[layout.js]"]
end

subgraph group_delivery["CI/CD delivery"]
  node_workflow["GitHub Actions<br/>[deploy.yml]"]
  node_imagebuild["Container image"]
  node_deployment["Kubernetes deployment<br/>[deployment.yml]"]
end

subgraph group_infrastructure["AWS infrastructure"]
  node_bootstrap["State bootstrap<br/>[main.tf]"]
  node_statebucket[("Terraform state bucket")]
  node_statelock[("State lock table")]
  node_network["VPC networking<br/>[vpc.tf]"]
  node_cluster["EKS cluster<br/>[eks.tf]"]
  node_registry["ECR repository<br/>[ecr.tf]"]
  node_terraformroot["Infrastructure configuration<br/>[main.tf]"]
end

node_developer(("Repository push"))
node_browser(("Application user"))

node_developer -->|"pushes main"| node_workflow
node_workflow -.->|"builds image"| node_imagebuild
node_imagebuild -.->|"publishes image"| node_registry
node_workflow -.->|"deploys resources"| node_deployment
node_deployment -->|"runs on"| node_cluster
node_bootstrap -->|"creates"| node_statebucket
node_bootstrap -->|"creates"| node_statelock
node_terraformroot -->|"provisions"| node_network
node_terraformroot -->|"provisions"| node_cluster
node_terraformroot -->|"provisions"| node_registry
node_browser -->|"accesses service"| node_cluster
node_rootlayout -.->|"renders children"| node_nextpage

click node_workflow "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/.github/workflows/deploy.yml"
click node_imagebuild "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/Dockerfile"
click node_deployment "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/k8s/deployment.yml"
click node_bootstrap "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/bootstrap/main.tf"
click node_network "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/vpc.tf"
click node_cluster "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/eks.tf"
click node_registry "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/ecr.tf"
click node_terraformroot "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/main.tf"
click node_nextpage "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/app/page.js"
click node_rootlayout "https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/app/layout.js"

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_nextpage,node_rootlayout,node_browser toneBlue
class node_workflow,node_imagebuild,node_deployment toneAmber
class node_bootstrap,node_statebucket,node_statelock,node_network,node_cluster,node_registry,node_terraformroot toneMint
class node_developer toneIndigo
```

## Components

### Web application

- [Home page](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/app/page.js): `app/page.js`
- [Root layout](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/app/layout.js): `app/layout.js`

### CI/CD delivery

- [GitHub Actions](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/.github/workflows/deploy.yml): `.github/workflows/deploy.yml`
- [Container image](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/Dockerfile): `Dockerfile`
- [Kubernetes deployment](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/k8s/deployment.yml): `k8s/deployment.yml`

### AWS infrastructure

- [State bootstrap](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/bootstrap/main.tf): `terraform/bootstrap/main.tf`
- **Terraform state bucket**
- **State lock table**
- [VPC networking](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/vpc.tf): `terraform/vpc.tf`
- [EKS cluster](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/eks.tf): `terraform/eks.tf`
- [ECR repository](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/ecr.tf): `terraform/ecr.tf`
- [Infrastructure configuration](https://github.com/nishi-panchal/cicd-terraform-eks/blob/main/terraform/main.tf): `terraform/main.tf`

### Other components

- **Repository push**
- **Application user**

## Connections

- Repository push → GitHub Actions: pushes main (evidence: `README.md`)
- GitHub Actions → Container image: builds image
- Container image → ECR repository: publishes image
- GitHub Actions → Kubernetes deployment: deploys resources
- Kubernetes deployment → EKS cluster: runs on (evidence: `README.md`)
- State bootstrap → Terraform state bucket: creates (evidence: `README.md`)
- State bootstrap → State lock table: creates (evidence: `README.md`)
- Infrastructure configuration → VPC networking: provisions (evidence: `README.md`)
- Infrastructure configuration → EKS cluster: provisions (evidence: `README.md`)
- Infrastructure configuration → ECR repository: provisions (evidence: `README.md`)
- Application user → EKS cluster: accesses service (evidence: `README.md`)
- Root layout → Home page: renders children
