# rohitmahesh025-alt/terraformcode architecture

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

- Interactive diagram: https://gitdiagram.com/rohitmahesh025-alt/terraformcode
- Repository: https://github.com/rohitmahesh025-alt/terraformcode

## Overview

#### Purpose and Entry Point
This is a Terraform repository for provisioning AWS infrastructure. The root composition point is `main.tf`, with infrastructure divided into service-focused Terraform units.

#### Root Orchestration
`main.tf` is the expected Terraform entry point for plan/apply operations. It likely connects or invokes the infrastructure areas represented by:
- `vpc/main.tf`
- `ec2/main.tf`
- `eks/main.tf`

Terraform state, provider configuration, variable contracts, and module wiring are architecturally important but are not visible in the supplied tree.

#### Network Foundation
The VPC layer defines the network boundary on which compute and Kubernetes resources depend:
- `vpc/main.tf`

This is the likely source of VPC, subnet, routing, and security-network identifiers consumed by downstream EC2 and EKS provisioning.

#### Compute and Object Storage
Standalone AWS workload resources are separated by concern:
- `ec2/main.tf`
- `s3/main.tf`

EC2 represents virtual-machine compute provisioning; S3 represents durable object storage. Their relationship is not explicit in the tree, so consumers, IAM access, and data exchange should be confirmed from Terraform references before changing dependencies.

#### Kubernetes Platform
The EKS area provisions or documents the managed Kubernetes platform:
- `eks/main.tf`
- `eks/readme.md`

EKS is expected to depend on the VPC/network layer and AWS IAM-related permissions. It forms a boundary between AWS infrastructure provisioning and later Kubernetes workload deployment; no Kubernetes manifests or application deployment code are present.

#### Identity and External Services
AWS identity setup is isolated from resource provisioning:
- `createuser/main.tf`

The repository’s material runtime is Terraform, targeting AWS services including VPC networking, EC2, S3, EKS, and IAM/user creation. The principal control flow is Terraform execution from `main.tf`, creating foundational networking first, then compute/storage and EKS resources according to declared dependency references.

Main entry points: [`main.tf`](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/main.tf) (Root composition), [`vpc/main.tf`](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/vpc/main.tf) (VPC network), [`eks/main.tf`](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/eks/main.tf) (EKS platform), [`ec2/main.tf`](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/ec2/main.tf) (EC2 compute)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terraform["Terraform units"]
  node_terraform_cli{{"Terraform plan/apply<br/>execution"}}
  node_root["Root composition<br/>Terraform entry point<br/>[main.tf]"]
  node_vpc["VPC network<br/>Terraform unit<br/>[main.tf]"]
  node_ec2["EC2 compute<br/>Terraform unit<br/>[main.tf]"]
  node_s3["S3 storage<br/>Terraform unit<br/>[main.tf]"]
  node_eks["EKS platform<br/>Terraform unit<br/>[main.tf]"]
  node_iam["IAM users<br/>Terraform unit<br/>[main.tf]"]
end

subgraph group_aws["AWS infrastructure"]
  node_aws{{"AWS account<br/>cloud target"}}
  node_kubernetes["Managed Kubernetes<br/>EKS service"]
end

node_terraform_cli -->|"executes"| node_root
node_root -.->|"composes"| node_vpc
node_root -.->|"composes"| node_ec2
node_root -.->|"composes"| node_eks
node_vpc -.->|"network IDs"| node_ec2
node_vpc -.->|"VPC and subnets"| node_eks
node_eks -->|"provisions"| node_kubernetes
node_vpc -->|"provisions"| node_aws
node_ec2 -->|"provisions"| node_aws
node_s3 -->|"provisions"| node_aws
node_eks -->|"provisions"| node_aws
node_iam -->|"creates identities"| node_aws

click node_root "https://github.com/rohitmahesh025-alt/terraformcode/blob/main/main.tf"
click node_vpc "https://github.com/rohitmahesh025-alt/terraformcode/blob/main/vpc/main.tf"
click node_ec2 "https://github.com/rohitmahesh025-alt/terraformcode/blob/main/ec2/main.tf"
click node_s3 "https://github.com/rohitmahesh025-alt/terraformcode/blob/main/s3/main.tf"
click node_eks "https://github.com/rohitmahesh025-alt/terraformcode/blob/main/eks/main.tf"
click node_iam "https://github.com/rohitmahesh025-alt/terraformcode/blob/main/createuser/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_terraform_cli,node_root,node_vpc,node_ec2,node_s3,node_eks,node_iam toneBlue
class node_aws,node_kubernetes toneAmber
```

## Components

### Terraform units

- **Terraform plan/apply**: execution · Primary operator runtime.
- [Root composition](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/main.tf): Terraform entry point · Expected entry point for infrastructure operations. · `main.tf`
- [VPC network](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/vpc/main.tf): Terraform unit · Network boundary and identifiers for downstream resources. · `vpc/main.tf`
- [EC2 compute](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/ec2/main.tf): Terraform unit · Standalone virtual-machine provisioning. · `ec2/main.tf`
- [S3 storage](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/s3/main.tf): Terraform unit · Durable object storage provisioning. · `s3/main.tf`
- [EKS platform](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/eks/main.tf): Terraform unit · Managed Kubernetes platform provisioning. · `eks/main.tf`
- [IAM users](https://github.com/rohitmahesh025-alt/terraformcode/blob/main/createuser/main.tf): Terraform unit · AWS identity setup isolated from resource provisioning. · `createuser/main.tf`

### AWS infrastructure

- **AWS account**: cloud target · Target environment for provisioned AWS services.
- **Managed Kubernetes**: EKS service · Boundary for later workload deployment; no manifests are present.

## Connections

- Terraform plan/apply → Root composition: executes
- Root composition → VPC network: composes
- Root composition → EC2 compute: composes
- Root composition → EKS platform: composes
- VPC network → EC2 compute: network IDs
- VPC network → EKS platform: VPC and subnets
- EKS platform → Managed Kubernetes: provisions
- VPC network → AWS account: provisions
- EC2 compute → AWS account: provisions
- S3 storage → AWS account: provisions
- EKS platform → AWS account: provisions
- IAM users → AWS account: creates identities
