# shivamsoni1995/setup-basic-aws-infrastructure-using-terraform architecture

> Architecture diagram of the GitHub repository shivamsoni1995/setup-basic-aws-infrastructure-using-terraform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform
- Repository: https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform

## Overview

##### Project type and purpose
- This is an Infrastructure-as-Code project using Terraform to provision a basic AWS network environment.
- According to the README ("Setup-basic-AWS-infrastructure-using-Terraform") and the file names, the goal is to create a VPC, its subnets, gateway, routing, security rules, and EC2 worker nodes.

##### File structure
- Top-level files (1-vpc.tf, 2-subnet.tf, etc.) each define a single AWS resource or related group of resources.
- There is no separate “modules” folder—this is a flat Terraform setup.
- State files (terraform.tfstate, terraform.tfstate.backup) indicate usage of local state.
- No CI/CD or backend configuration files are present, so Terraform is run locally or via simple automation.

##### README for additional insights
- The README is minimal. It confirms the scope: stand up a VPC and related networking plus EC2 workers.

##### Essential elements
- Labels: “Terraform CLI,” “AWS API/Provider,” “VPC,” “Subnet A,” “Subnet B,” “Internet Gateway,” etc.
- From Terraform to AWS API (deployment action)
- From IGW to VPC (attachment)
- From Route Table to Subnet (association)
- From EC2 to Security Group (attachment)

## Diagram (Mermaid)

```mermaid
graph TD
    TerraformCLI["Terraform CLI / Commands"]:::terraform
    LocalState["Terraform Local State"]:::state
    AWSAPI["AWS Provider API"]:::awsapi

    TerraformCLI -->|manages state| LocalState
    TerraformCLI -->|provisions| AWSAPI

    subgraph "AWS Cloud"
        subgraph "VPC"
            VPC["VPC"]:::vpc

            IGW["Internet Gateway"]:::igw
            IGW -->|attached to| VPC

            subgraph "Subnets"
                PubSubnet["Public Subnet (Subnet A)"]:::subnetPublic
                PrivSubnet["Private Subnet (Subnet B)"]:::subnetPrivate
            end

            RT["Route Table"]:::rt
            RT -->|associated with| PubSubnet
            RT -->|associated with| PrivSubnet

            RTA["Route Table Association"]:::rta
            RTA -->|links RT to Subnet| RT
            RTA --> PrivSubnet

            SG["Security Group"]:::sg

            EC2["EC2 Worker Instance"]:::ec2
            EC2 -->|located in| PubSubnet
            EC2 -->|uses| SG
        end
    end

    doc["Project Documentation"]:::doc

    click TerraformCLI "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/Terraform command.txt"
    click LocalState "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/terraform.tfstate"
    click LocalState "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/terraform.tfstate.backup"
    click VPC "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/1-vpc.tf"
    click PubSubnet "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/2-subnet.tf"
    click PrivSubnet "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/2-subnet.tf"
    click SG "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/3-security-group.tf"
    click IGW "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/4-ig.tf"
    click RT "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/5-route-table.tf"
    click RTA "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/6-route-table-association.tf"
    click EC2 "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/7-ec2-worker.tf"
    click doc "https://github.com/shivamsoni1995/setup-basic-aws-infrastructure-using-terraform/blob/main/README.md"

    classDef terraform fill:#f9f,stroke:#333,stroke-width:2px
    classDef state fill:#ccc,stroke:#333,stroke-width:2px
    classDef awsapi fill:#ffe4b5,stroke:#333,stroke-width:2px
    classDef vpc fill:#e0e0ff,stroke:#333,stroke-width:2px
    classDef subnetPublic fill:#e0ffe0,stroke:#2e8b57,stroke-width:2px
    classDef subnetPrivate fill:#e0e7f7,stroke:#1f4f8b,stroke-width:2px
    classDef igw fill:#fff0f0,stroke:#fa8072,stroke-width:2px
    classDef rt fill:#fffacd,stroke:#daa520,stroke-width:2px
    classDef rta fill:#fafafa,stroke:#999,stroke-width:2px
    classDef sg fill:#ffe4e1,stroke:#cd5c5c,stroke-width:2px
    classDef ec2 fill:#e6e6fa,stroke:#9370db,stroke-width:2px
    classDef doc fill:#f0fff0,stroke:#333,stroke-width:2px
```
