# build5nines/terraform-quickstart-templates architecture

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

- Interactive diagram: https://gitdiagram.com/build5nines/terraform-quickstart-templates
- Repository: https://github.com/build5nines/terraform-quickstart-templates

## Overview

##### Project Type & Purpose
- The project is an Infrastructure as Code (IaC) repository offering Terraform quickstart templates for Microsoft Azure. Its goal is to provide sample configurations and reusable modules that guide users in provisioning Azure resources using Terraform. It also includes generic Terraform tips and best practice examples.

##### Main Components
a. GitHub Workflows & CI:
- A set of GitHub workflows (located under .github/workflows) are configured to validate various Terraform configurations (e.g., for azure modules, quickstarts, workloads, and generic Terraform tips).
b. Microsoft Azure Cloud Infrastructure:
- Modules: Reusable Terraform modules (found in microsoft-azure/modules) for provisioning specific Azure resources like App Service Plan, Application Insights, Virtual Networks, etc.
- Quickstarts: A collection of sample templates (organized under microsoft-azure/quickstarts) that provide guided examples for various Azure services including CDN, Kubernetes clusters, IoT Hubs, storage accounts, and more.
- Workloads: More comprehensive examples (in microsoft-azure/workloads) that combine multiple resources to model full workload deployments.
c. Generic Terraform Guidance:
- Terraform Tips (in terraform-tips folder): These are independent examples showcasing Terraform techniques (e.g., CIDR tester, string manipulation, json loading) that are not tied to any specific cloud provider.

##### Relationships & Interactions
- Quickstarts and Workloads consume these Modules.
- That the GitHub workflows are continuously validating changes, ensuring that the configurations in Modules, Quickstarts, and Terraform Tips are tested.
- Segregation between cloud-specific examples (Microsoft Azure) and generic Terraform best practices (Terraform Tips).

##### Architectural Patterns & Design Principles
- The repository is modular and reusable, reflecting the DRY (Don’t Repeat Yourself) principle in IaC.
- There is a clear separation of concerns: Azure-specific examples are grouped distinctly from generic Terraform tips.
- The design supports a plug-and-play model – users can pick from modular templates or full quickstart examples to deploy Azure resources.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% GitHub CI/Validation Cluster
    subgraph "GitHub CI/Validation"
        A("GitHub Workflows"):::ci
        B("tf-validate-all.sh"):::ci
    end

    %% Microsoft Azure Templates Cluster
    subgraph "Microsoft Azure Templates"
        %% Modules Subcluster
        subgraph "Modules"
            M1("azure_app_service_plan"):::azure
            M2("azure_virtual_network"):::azure
            U("Azure Modules"):::azure
            M1 --> U
            M2 --> U
        end
        %% Quickstart Templates Subcluster
        subgraph "Quickstart Templates"
            Q1("Azure CDN"):::azure
            Q2("Azure Kubernetes"):::azure
            Q3("Azure IoT Hubs"):::azure
        end
        %% Workload Examples Subcluster
        subgraph "Workload Examples"
            W1("azure-express-route-with-vnet-gateway"):::azure
        end
    end

    %% Terraform Tips Cluster
    subgraph "Terraform Tips"
        T1("CIDR Tester"):::tips
        T2("String Concat"):::tips
        T3("JSON Load File"):::tips
    end

    %% Connections from GitHub Workflows to Components
    A -->|"validates"| U
    A -->|"validates"| Q1
    A -->|"validates"| Q2
    A -->|"validates"| Q3
    A -->|"validates"| W1
    A -->|"validates"| T1
    A -->|"validates"| T2
    A -->|"validates"| T3

    %% Dependencies: Azure Modules consumed by Quickstarts and Workloads
    U -->|"used_by"| Q1
    U -->|"used_by"| Q2
    U -->|"used_by"| Q3
    U -->|"used_by"| W1

    %% Styles
    classDef ci fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef azure fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef tips fill:#fff3cd,stroke:#856404,stroke-width:2px;

    %% Click Events
    click A "https://github.com/build5nines/terraform-quickstart-templates/tree/main/.github/workflows"
    click B "https://github.com/build5nines/terraform-quickstart-templates/blob/main/.github/tf-validate-all.sh"
    click M1 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/modules/azure_app_service_plan"
    click M2 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/modules/azure_virtual_network"
    click U "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/modules"
    click Q1 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/quickstarts"
    click Q2 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/quickstarts"
    click Q3 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/quickstarts"
    click W1 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/microsoft-azure/workloads/azure-express-route-with-vnet-gateway"
    click T1 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/terraform-tips"
    click T2 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/terraform-tips"
    click T3 "https://github.com/build5nines/terraform-quickstart-templates/tree/main/terraform-tips"
```
