# mofaizal/fun-project-playground architecture

> Architecture diagram of the GitHub repository mofaizal/fun-project-playground, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mofaizal/fun-project-playground
- Repository: https://github.com/mofaizal/fun-project-playground

## Overview

##### Main Components
- AVM Core Modules: These are the reusable, parameterized module definitions (e.g., “alz” directory and its archetype definitions) that represent core building blocks of Azure landing zones.
- Infrastructure Examples: Each of the directories named “avm-<...>” (for example, avm-workload, avm-vnet-lb-vmss, avm-secure-hub, etc.) represents one example deployment and should be considered as an independent sub-system.
- Network Components: Within these examples, identify key infrastructure elements such as Virtual Networks (VNETs), Subnets, Network Security Groups (NSGs), and connection components (e.g., VPN setups, peering).
- Compute and Application Layers: Examples using VM Scale Sets, application gateways, load balancers, and application workload deployments.
- Support Files: Files like variables.tf, terraform.tfvars.sample, and main.tf indicate configuration points and parameter sets that guide the module behavior.

##### Relationships and Interactions
- Directional data flow from input parameters (defined in terraform.tfvars or settings files) into the module configurations that then deploy Azure resources.

##### Architectural Patterns and Design Principles
- Modularity: Emphasize how the repository separates concerns by having a central library of AVM modules (the “alz” directory and its archetypes) and a collection of example deployments in different directories.
- Parameterization & Reusability: Note the use of variable files and environment-specific settings (e.g., separate tf files for dev, non-prod, prod) which underpin the design.
- Layered Architecture: Indicate distinct layers such as the networking layer (VNETs, subnets, NSGs), the compute/application layer (VMSS, app gateway), and potentially the security layer (secure hub modules) that interact to build comprehensive environments.

##### Relevant Technologies
- Terraform – Used for infrastructure-as-code deployments.
- Azure Verified Modules – Acting as the reference implementation for deploying Azure networks, compute resources, and more.
- YAML and JSON configurations – For module definitions and custom extensions.
- Shell Scripts – As seen in the app gateway SSL certificate generation scripts, which show operational execution steps in the modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% AVM Core Modules
    subgraph "AVM Core Modules"
        core1["AVM Core: alz"]:::core
        core2["Archetype Definitions (alz/lib/archetype_definition)"]:::core
    end

    %% Support Files
    subgraph "Support Files"
        sup1["Global Variables (variables.tf)"]:::support
        sup2["Terraform Sample (terraform.tfvars.sample)"]:::support
        sup3["Core Settings (settings.core.*.tf)"]:::support
        sup4["Common Terraform (main.tf, terraform.tf)"]:::support
    end

    %% Infrastructure Examples
    subgraph "Infrastructure Examples"
        %% Networking Deployments
        subgraph "Networking Deployments"
            net1["avm-peer-vnet"]:::example
            net2["avm-pvresolver-and-vnet"]:::example
            net3["avm-vnet-lb-vmss"]:::example
            net4["avm-vwan-securehub"]:::example
            net5["avm-vwan"]:::example
        end
        %% Compute/Application Deployments
        subgraph "Compute/Application Deployments"
            comp1["avm-vmss-app-gateway"]:::example
            comp2["avm-workload-apps"]:::example
            comp3["avm-workload-vnet-lb-appgateway"]:::example
            comp4["avm-workload-vnet"]:::example
            comp5["avm-workload"]:::example
            comp6["avm-alz"]:::example
            comp7["avm-vm-data-disk"]:::example
        end
    end

    %% Relationships from Support Files to Infrastructure Examples
    sup1 -->|"parameters"| net1
    sup1 -->|"parameters"| net2
    sup1 -->|"parameters"| net3
    sup1 -->|"parameters"| net4
    sup1 -->|"parameters"| net5
    sup1 -->|"parameters"| comp1
    sup1 -->|"parameters"| comp2
    sup1 -->|"parameters"| comp3
    sup1 -->|"parameters"| comp4
    sup1 -->|"parameters"| comp5
    sup1 -->|"parameters"| comp6
    sup1 -->|"parameters"| comp7

    %% Relationships from Support Files to AVM Core Modules
    sup2 -->|"guides"| core1
    sup3 -->|"guides"| core2

    %% Infrastructure Examples depend on AVM Core Modules
    net1 -->|"consumes"| core1
    net2 -->|"consumes"| core1
    net3 -->|"consumes"| core1
    net4 -->|"consumes"| core1
    net5 -->|"consumes"| core1
    comp1 -->|"consumes"| core1
    comp2 -->|"consumes"| core1
    comp3 -->|"consumes"| core1
    comp4 -->|"consumes"| core1
    comp5 -->|"consumes"| core1
    comp6 -->|"consumes"| core1
    comp7 -->|"consumes"| core1

    %% Interactions Between Networking and Compute/Application Layers
    net3 -->|"providesNetwork"| comp1
    net5 -->|"providesVNET"| comp4
    net2 -->|"peeringSupports"| comp3

    %% Click Events for Core Modules and Support Files
    click core1 "https://github.com/mofaizal/fun-project-playground/tree/main/alz"
    click core2 "https://github.com/mofaizal/fun-project-playground/tree/main/alz/lib/archetype_definition"
    click sup1 "https://github.com/mofaizal/fun-project-playground/blob/main/alz/variables.tf"
    click sup2 "https://github.com/mofaizal/fun-project-playground/blob/main/alz/terraform.tfvars.sample"
    click sup3 "https://github.com/mofaizal/fun-project-playground/blob/main/alz/settings.core.*.tf"
    click sup4 "https://github.com/mofaizal/fun-project-playground/blob/main/avm-workload/main.tf"

    %% Click Events for Infrastructure Examples - Networking
    click net1 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-peer-vnet"
    click net2 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-pvresolver-and-vnet"
    click net3 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-vnet-lb-vmss"
    click net4 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-vwan-securehub"
    click net5 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-vwan"

    %% Click Events for Infrastructure Examples - Compute/Application
    click comp1 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-vmss-app-gateway"
    click comp2 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-workload-apps"
    click comp3 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-workload-vnet-lb-appgateway"
    click comp4 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-workload-vnet"
    click comp5 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-workload"
    click comp6 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-alz"
    click comp7 "https://github.com/mofaizal/fun-project-playground/tree/main/avm-vm-data-disk"

    %% Class Definitions for Colors and Styles
    classDef core fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef support fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef example fill:#d4edda,stroke:#155724,stroke-width:2px;
```
