# velez94/terragrunt_aws_gitops_blueprint architecture

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

- Interactive diagram: https://gitdiagram.com/velez94/terragrunt_aws_gitops_blueprint
- Repository: https://github.com/velez94/terragrunt_aws_gitops_blueprint

## Overview

##### Project Type and Purpose
- This is an infrastructure-as-code GitOps blueprint. It uses Terragrunt to orchestrate Terraform modules that provision AWS infrastructure (VPC, IAM, SSM, EKS) and then bootstraps an Argo CD–driven GitOps pipeline on the EKS cluster.
- Key goals: modular infra setup, multi-environment support, automated application deployment via Argo CD.

##### Main Components
a. Git Repositories
- Infra Repo: hosts Terragrunt and Terraform code.
- GitOps App Repos: contain cluster-addons and platform resources.
b. Terragrunt/Terraform Layer
- common/ (variables, providers, environment configs)
- modules/terraform-aws-* (IRSA for EKS, SSM parameter store)
- infrastructure/
- network/vpc
- iam/eks_role
- ssm/parameter_store
- containers/eks_control_plane
- containers/gitops_bridge (Argo CD bootstrap: ApplicationSets).
c. AWS Infrastructure
- VPC: networking, subnets, security groups.
- IAM: EKS control-plane role.
- SSM Parameter Store: central config store.
- EKS Cluster (control plane + worker nodes).
d. GitOps Bridge & Argo CD
- On EKS: Argo CD server & ApplicationSets.
- Argo CD syncs cluster-addons and platform resources from Git.

##### Relationships & Data Flow
- [Git Infra Repo] → Terragrunt CLI → Terraform → [AWS Infrastructure]
- [AWS Infrastructure] includes VPC → IAM → SSM → EKS Cluster.
- [GitOps Bridge] (via Terragrunt) deploys Argo CD onto EKS.
- [Argo CD] ← polls → [Git App Repos] → applies → EKS cluster workloads.
- Feedback loops: Argo CD continuously reconciles desired state.

##### Architectural Patterns & Principles
- Infrastructure as Code (Terragrunt + Terraform modules).
- GitOps (declarative desired-state in Git, continuous reconciliation).
- Modular design (common configs + reusable modules).
- Multi-environment layering (Terragrunt environment.hcl).
- Separation of concerns: infra provisioning vs. app deployment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer/Git Layer
    subgraph "Developer/Git" 
        direction TB
        InfraRepo["Infra Repo"]:::repo
        AppRepos["App Repos"]:::repo
    end

    %% CI/CD Layer
    subgraph "CI/CD" 
        direction TB
        Terragrunt["Terragrunt CLI / Terraform"]:::tool
        CommonConfigs["Common Terragrunt Configs"]:::config
        IRSA_Module["IRSA Module"]:::module
        SSM_Module["SSM Parameter Store Module"]:::module
    end

    %% AWS Cloud Layer
    subgraph "AWS Cloud" 
        direction TB
        VPC["VPC"]:::aws
        IAM["IAM (EKS Control Plane Role)"]:::aws
        SSM["SSM Parameter Store"]:::aws
        EKS["EKS Cluster"]:::aws
    end

    %% Kubernetes Layer
    subgraph "Kubernetes (EKS)" 
        direction TB
        GitOpsBridge["GitOps Bridge"]:::tool
        ArgoCD["Argo CD"]:::k8s
        AppSets["ApplicationSets"]:::k8s
        Workloads["Cluster Workloads"]:::k8s
    end

    %% Relationships
    InfraRepo -->|"git clone"| Terragrunt
    Terragrunt -->|"uses common configs"| CommonConfigs
    Terragrunt -->|"provisions IRSA"| IRSA_Module
    Terragrunt -->|"provisions SSM"| SSM_Module
    Terragrunt -->|"terraform apply"| VPC
    Terragrunt -->|"terraform apply"| IAM
    Terragrunt -->|"terraform apply"| SSM
    Terragrunt -->|"terraform apply"| EKS

    EKS -->|"bootstrap Argo CD"| GitOpsBridge
    GitOpsBridge -->|"deploys"| ArgoCD
    AppRepos -->|"sync ApplicationSets"| AppSets
    ArgoCD -->|"applies"| Workloads

    %% Dashed for common variables/modules
    CommonConfigs -.-> Terragrunt

    %% Click Events
    click InfraRepo "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/root.hcl"
    click CommonConfigs "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/common/common.hcl"
    click IRSA_Module "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/modules/terraform-aws-irsa-eks-hub/main.tf"
    click SSM_Module "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/modules/terraform-aws-ssm-parameter-sotre/main.tf"
    click VPC "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/infrastructure/network/vpc/terragrunt.hcl"
    click IAM "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/infrastructure/iam/eks_role/terragrunt.hcl"
    click SSM "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/infrastructure/ssm/parameter_store/terragrunt.hcl"
    click EKS "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/infrastructure/containers/eks_control_plane/terragrunt.hcl"
    click GitOpsBridge "https://github.com/velez94/terragrunt_aws_gitops_blueprint/blob/main/infrastructure/containers/gitops_bridge/terragrunt.hcl"

    %% Styles
    classDef repo fill:#2196f3,stroke:#0b3c5d,color:#fff;
    classDef tool fill:#4caf50,stroke:#2e7d32,color:#fff;
    classDef config fill:#9e9e9e,stroke:#616161,color:#fff,stroke-dasharray: 5 5;
    classDef module fill:#ffeb3b,stroke:#fbc02d,color:#000;
    classDef aws fill:#ff9800,stroke:#e65100,color:#000;
    classDef k8s fill:#b39ddb,stroke:#512da8,color:#000;
```
