# prithvirajmagar/terraform-zero-to-hero architecture

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

- Interactive diagram: https://gitdiagram.com/prithvirajmagar/terraform-zero-to-hero
- Repository: https://github.com/prithvirajmagar/terraform-zero-to-hero

## Overview

##### Main Components

a) Learning Path Flow:

b) Technical Components:
- AWS Infrastructure Layer
- EC2 instances
- VPC components
- S3 (for backend storage)
- DynamoDB (for state locking)
- Terraform Components
- State Management
- Modules
- Providers
- Variables/tfvars
- Security Layer
- HashiCorp Vault integration
- AWS credentials management

##### Infrastructure Layer
**[AWS Resources] ← [Terraform Configurations] ← [State Management]**

##### Development Flow
**[Local Development] → [Version Control] → [Remote Backend] → [Production Infrastructure]**

##### Security Framework
**[HashiCorp Vault] → [Secrets Management] → [AWS Credentials]**

Top Section:
**[Course Structure (Days 1-8)]**
- ↓
**[Learning Progression]**

Middle Section:
**[Terraform Configuration] → [Provider Configuration] → [Resource Definition]**
- ↓
**[State Management (S3/DynamoDB)] ← [Module System]**

Bottom Section:
**[Security Layer (Vault)] → [Infrastructure Deployment] → [AWS Resources]**

##### Important Elements to Highlight

- Progression from basic EC2 instance creation to complex VPC setups
- Modular architecture using the modules directory structure
- Demonstrate the state management flow with backend configurations
- Security integration with HashiCorp Vault
- Relationship between variables, providers, and resources

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Learning Path
    subgraph LearningPath["Learning Path"]
        direction TB
        Day1[Day 1: Basics]:::basic --> Day2[Day 2: VPC & Variables]:::intermediate
        Day2 --> Day3[Day 3: Modules]:::intermediate
        Day3 --> Day4[Day 4: State Management]:::intermediate
        Day4 --> Day5[Day 5: Provisioners]:::advanced
        Day5 --> Day6[Day 6: Advanced Modules]:::advanced
        Day6 --> Day7[Day 7: Security]:::advanced
        Day7 --> Day8[Day 8: Best Practices]:::advanced
    end

    %% Infrastructure Layer
    subgraph InfraLayer["Infrastructure Layer"]
        direction TB
        EC2["EC2 Instances"]:::aws
        VPC["VPC Components"]:::aws
        S3["S3 Backend"]:::storage
        DynamoDB["DynamoDB Lock"]:::storage
    end

    %% Terraform Configuration Layer
    subgraph TerraformLayer["Terraform Layer"]
        direction TB
        Provider["Provider Config"]:::terraform
        Variables["Variables"]:::terraform
        Modules["Module System"]:::terraform
        State["State Management"]:::terraform
    end

    %% Security Layer
    subgraph SecurityLayer["Security Layer"]
        direction TB
        Vault["HashiCorp Vault"]:::security
        SecureImpl["Secure Implementation"]:::security
        AWSCreds["AWS Credentials"]:::security
    end

    %% Relationships
    Provider --> EC2
    Provider --> VPC
    Variables --> Provider
    Modules --> EC2
    Modules --> VPC
    State --> S3
    State --> DynamoDB
    Vault --> SecureImpl
    SecureImpl --> AWSCreds
    AWSCreds --> Provider

    %% Styling
    classDef basic fill:#90EE90
    classDef intermediate fill:#ADD8E6
    classDef advanced fill:#FFB6C1
    classDef aws fill:#FF9900
    classDef terraform fill:#844FBA
    classDef security fill:#FF0000
    classDef storage fill:#FFFF00

    %% Click Events
    click EC2 "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-1/PROJECT-ec2-instance-creation/main.tf"
    click VPC "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-2/PROJECT-vpc-with-ec2/main.tf"
    click Provider "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-2/PROJECT-vpc-with-ec2/provider.tf"
    click Variables "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-2/PROJECT-vpc-with-ec2/variables.tf"
    click Modules "https://github.com/prithvirajmagar/terraform-zero-to-hero/tree/main/Day-3/modules/ec2_instance/"
    click State "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-4/statefile_scenarios.md"
    click SecureImpl "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-7/01-secure-terraform.md"
    click Vault "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-7/02-vault-integration.md"
    click AWSCreds "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-1/04-aws-connection.md"
    click S3 "https://github.com/prithvirajmagar/terraform-zero-to-hero/blob/main/Day-4/backend.tf"
```
