# joshivrush/aws-ecs-vpc-alb-apigw architecture

> Architecture diagram of the GitHub repository joshivrush/aws-ecs-vpc-alb-apigw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joshivrush/aws-ecs-vpc-alb-apigw
- Repository: https://github.com/joshivrush/aws-ecs-vpc-alb-apigw

## Overview

##### Main Components
- AWS Cloud boundary
- VPC component with its networking elements
- ECS Cluster and Services
- Application Load Balancer
- API Gateway
- Relevant security groups and IAM roles

##### Connection Flow
- Internet → API Gateway
- API Gateway → ALB
- ALB → ECS Services
- ECS Services → Other AWS services (if applicable)

##### Security Elements
- Security Groups (use distinct symbols)
- IAM Roles and Policies
- Network ACLs
- VPC Endpoints if applicable

##### Additional Elements
- Version/date information
- Notes for any specific configurations
- Document any assumptions made

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Internet
        client[Client]
    end

    subgraph "API Layer"
        apigw["API Gateway"]:::apigateway
    end

    subgraph "VPC"
        subgraph "Public Subnet AZ1"
            alb["Application Load Balancer"]:::loadbalancer
            nat1["NAT Gateway 1"]:::network
        end

        subgraph "Public Subnet AZ2"
            nat2["NAT Gateway 2"]:::network
        end

        subgraph "Private Subnet AZ1"
            ecs1["ECS Tasks/Containers"]:::compute
        end

        subgraph "Private Subnet AZ2"
            ecs2["ECS Tasks/Containers"]:::compute
        end

        igw["Internet Gateway"]:::network
    end

    %% Connections
    client --> apigw
    apigw --> alb
    alb --> ecs1
    alb --> ecs2
    ecs1 -.-> nat1
    ecs2 -.-> nat2
    nat1 --> igw
    nat2 --> igw
    igw --> Internet

    %% Styles
    classDef default fill:#fff,stroke:#000,stroke-width:2px
    classDef apigateway fill:#A166FF,stroke:#000,color:#fff
    classDef loadbalancer fill:#82B366,stroke:#000,color:#fff
    classDef compute fill:#FF9900,stroke:#000,color:#fff
    classDef network fill:#4267B2,stroke:#000,color:#fff

    %% Legend
    subgraph Legend
        l1["API Gateway"]:::apigateway
        l2["Load Balancer"]:::loadbalancer
        l3["Compute (ECS)"]:::compute
        l4["Network Components"]:::network
    end
```
