# widdix/aws-cf-templates architecture

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

- Interactive diagram: https://gitdiagram.com/widdix/aws-cf-templates
- Repository: https://github.com/widdix/aws-cf-templates

## Overview

##### Main Component Categories

a. Infrastructure Components:
- VPC (Network Layer)
- EC2 (Compute Layer)
- ECS (Container Layer)
- Fargate (Serverless Container Layer)
- State (Data Layer)
- Security
- Operations

##### Hierarchical Structure

Level 1 (Top Level):

Level 2 (Template Groups):
- Within each category, show the available template variations
- For example, under VPC:
- 2-AZ configuration
- 3-AZ configuration
- 4-AZ configuration
- VPC endpoints
- Flow logs

##### Specific Elements

Core Infrastructure:
**[VPC Templates] → [Compute Layer (EC2/ECS/Fargate)] → [State Layer]**
- ↑                         ↑                           ↑

**[Security Layer] -------- [Operations Layer] ------- [Monitoring/Logs]**

Service-Specific Implementations:
- WordPress HA setup
- Jenkins deployment
- Static website hosting

##### Additional Details

Metadata Section:
- Template version compatibility
- AWS region support
- Required permissions
- Dependencies between templates

Integration Points:
- Where custom parameters can be injected
- Integration with external services (e.g., GitHub for auth)
- Points where monitoring and logging are implemented

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Infrastructure"]
        direction TB
        VPC["VPC Templates"]
        Compute["Compute Layer"]
        State["State Layer"]
        Security["Security Layer"]
        Operations["Operations Layer"]
        Monitoring["Monitoring/Logs"]
    end

    subgraph NetworkLayer["Network Templates"]
        direction TB
        VPC2AZ["2-AZ Config"]
        VPC3AZ["3-AZ Config"]
        VPC4AZ["4-AZ Config"]
        VPCEndpoints["VPC Endpoints"]
        FlowLogs["Flow Logs"]
    end

    subgraph ComputeLayer["Compute Resources"]
        direction TB
        EC2["EC2 Instances"]
        ECS["ECS Clusters"]
        Fargate["Fargate Services"]
    end

    subgraph StateLayer["Data Storage"]
        direction TB
        RDS["RDS Aurora"]
        DynamoDB["DynamoDB"]
        Redis["ElastiCache Redis"]
        S3["S3 Buckets"]
    end

    subgraph SecurityLayer["Security Components"]
        direction TB
        CloudTrail["CloudTrail"]
        WAF["WAF"]
        KMS["KMS Keys"]
        Config["AWS Config"]
    end

    subgraph OperationsLayer["Operations"]
        direction TB
        Alerts["Alerts"]
        TerraformState["Terraform State"]
        GitHubOIDC["GitHub OIDC"]
    end

    subgraph Implementations["Service Implementations"]
        direction TB
        WordPress["WordPress HA"]
        Jenkins["Jenkins HA"]
        StaticWeb["Static Website"]
    end

    subgraph Testing["Testing & CI/CD"]
        direction TB
        TestFramework["Test Framework"]
        CICD["GitHub Actions"]
    end

    %% Core relationships
    VPC --> Compute
    Compute --> State
    Security --> VPC
    Security --> Compute
    Security --> State
    Operations --> Security
    Operations --> Monitoring

    %% Implementation dependencies
    WordPress --> VPC
    WordPress --> Compute
    WordPress --> State
    Jenkins --> VPC
    Jenkins --> Compute
    StaticWeb --> S3

    %% Testing relationships
    TestFramework --> Core
    TestFramework --> Implementations
    CICD --> TestFramework

    %% Click events for component mapping
    click VPC "https://github.com/widdix/aws-cf-templates/tree/master/vpc/"
    click EC2 "https://github.com/widdix/aws-cf-templates/tree/master/ec2/"
    click ECS "https://github.com/widdix/aws-cf-templates/tree/master/ecs/"
    click Fargate "https://github.com/widdix/aws-cf-templates/tree/master/fargate/"
    click State "https://github.com/widdix/aws-cf-templates/tree/master/state/"
    click Security "https://github.com/widdix/aws-cf-templates/tree/master/security/"
    click Operations "https://github.com/widdix/aws-cf-templates/tree/master/operations/"
    click WordPress "https://github.com/widdix/aws-cf-templates/tree/master/wordpress/"
    click Jenkins "https://github.com/widdix/aws-cf-templates/tree/master/jenkins/"
    click StaticWeb "https://github.com/widdix/aws-cf-templates/tree/master/static-website/"
    click TestFramework "https://github.com/widdix/aws-cf-templates/tree/master/test/src/test/java/de/widdix/awscftemplates/"
    click CICD "https://github.com/widdix/aws-cf-templates/tree/master/.github/workflows/"
    click VPC2AZ "https://github.com/widdix/aws-cf-templates/blob/master/vpc/vpc-2azs.yaml"
    click VPC3AZ "https://github.com/widdix/aws-cf-templates/blob/master/vpc/vpc-3azs.yaml"
    click VPC4AZ "https://github.com/widdix/aws-cf-templates/blob/master/vpc/vpc-4azs.yaml"
    click FlowLogs "https://github.com/widdix/aws-cf-templates/blob/master/vpc/vpc-flow-logs.yaml"
    click CloudTrail "https://github.com/widdix/aws-cf-templates/blob/master/security/cloudtrail.yaml"
    click WAF "https://github.com/widdix/aws-cf-templates/blob/master/security/waf.yaml"
    click KMS "https://github.com/widdix/aws-cf-templates/blob/master/security/kms-key.yaml"
    click Config "https://github.com/widdix/aws-cf-templates/blob/master/security/config.yaml"
    click RDS "https://github.com/widdix/aws-cf-templates/blob/master/state/rds-aurora.yaml"
    click DynamoDB "https://github.com/widdix/aws-cf-templates/blob/master/state/dynamodb.yaml"
    click Redis "https://github.com/widdix/aws-cf-templates/blob/master/state/elasticache-redis.yaml"
    click S3 "https://github.com/widdix/aws-cf-templates/blob/master/state/s3.yaml"

    %% Styling
    classDef network fill:#a8d1ff
    classDef compute fill:#90EE90
    classDef storage fill:#FFE5B4
    classDef security fill:#FFB6C1
    classDef operations fill:#DDA0DD
    classDef implementation fill:#98FB98
    classDef testing fill:#F0E68C

    class VPC,NetworkLayer,VPC2AZ,VPC3AZ,VPC4AZ,VPCEndpoints,FlowLogs network
    class Compute,ComputeLayer,EC2,ECS,Fargate compute
    class State,StateLayer,RDS,DynamoDB,Redis,S3 storage
    class Security,SecurityLayer,CloudTrail,WAF,KMS,Config security
    class Operations,OperationsLayer,Alerts,TerraformState,GitHubOIDC operations
    class WordPress,Jenkins,StaticWeb,Implementations implementation
    class TestFramework,CICD,Testing testing
```
