# vravind1/terraform-eks architecture

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

- Interactive diagram: https://gitdiagram.com/vravind1/terraform-eks
- Repository: https://github.com/vravind1/terraform-eks

## Overview

##### Project Type and Purpose
- The project uses Terraform scripts to create and manage an EKS cluster, configure a Virtual Private Cloud (VPC), and set up related networking components.
- The README clarifies how to initialize, plan, and apply Terraform configurations while also guiding the user to interact with the EKS cluster using tools like kubectl and aws-cli.

##### Analyzing the File Structure
- The top-level files are all Terraform configuration files such as:
- main.tf – likely the primary orchestration file.
- eks-cluster.tf – likely contains the configuration for provisioning the EKS cluster.
- vpc.tf – configuration for setting up the Virtual Private Cloud (VPC) used by the cluster.
- outputs.tf, variables.tf, terraform.tf, and .terraform.lock.hcl for managing inputs, outputs, and provider configurations.
- The presence of these files indicates a clear separation of concerns within the provisioning scripts (e.g., networking vs. cluster deployment).

##### Core Components
a. Terraform Environment:
- Terraform execution environment where the code is applied. It handles initialization (terraform init), planning (terraform plan), and applying (terraform apply) stages.
b. AWS Cloud Infrastructure:
- AWS as the cloud provider.
- A component for the VPC (from vpc.tf) that configures the networking environment.
c. EKS Cluster:
- Nodes or worker groups that will run Kubernetes workloads.
d. Auxiliary Tools:
e. State Management & Configuration Files:
- How Terraform’s state file (implied by the locking mechanism) is part of the management process, ensuring the current configuration is correctly captured.

##### Relationships and Interactions
- That Terraform uses configuration files (main.tf, eks-cluster.tf, vpc.tf, etc.) to control AWS resource creation.
- Dependencies between the VPC and the EKS cluster, since the cluster resides within the networking context defined by the VPC.

##### Architectural Patterns & Design Principles
- Infrastructure-as-Code (IaC) principles with Terraform orchestrating the complete lifecycle of cloud resources.
- Clear separation of configuration concerns (networking vs. cluster setup).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Terraform Environment Subgraph
    subgraph "Terraform Environment"
        T1["main.tf"]:::terraform
        T2["variables.tf"]:::terraform
        T3["outputs.tf"]:::terraform
        T4["terraform.tf"]:::terraform
        T5[".terraform.lock.hcl"]:::terraform
    end

    %% AWS Cloud Infrastructure Subgraph
    subgraph "AWS Cloud Infrastructure"
        A1["VPC Configuration"]:::aws
        A2["EKS Cluster Provisioning"]:::eks
    end

    %% Management Tools Subgraph
    subgraph "Management Tools"
        M1["aws-cli"]:::tools
        M2["kubectl"]:::tools
    end

    %% Connections
    T1 -->|"terraform_apply"| A1
    T1 -->|"terraform_apply"| A2
    A1 -->|"network_dependency"| A2
    A2 -->|"command_execution"| M1
    A2 -->|"command_execution"| M2

    %% Click Events
    click T1 "https://github.com/vravind1/terraform-eks/blob/main/main.tf"
    click T2 "https://github.com/vravind1/terraform-eks/blob/main/variables.tf"
    click T3 "https://github.com/vravind1/terraform-eks/blob/main/outputs.tf"
    click T4 "https://github.com/vravind1/terraform-eks/blob/main/terraform.tf"
    click T5 "https://github.com/vravind1/terraform-eks/blob/main/.terraform.lock.hcl"
    click A1 "https://github.com/vravind1/terraform-eks/blob/main/vpc.tf"
    click A2 "https://github.com/vravind1/terraform-eks/blob/main/eks-cluster.tf"

    %% Styles
    classDef terraform fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
    classDef aws fill:#E8F8F5,stroke:#28B463,stroke-width:2px;
    classDef eks fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef tools fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
```
