# drhelius/terraform-azure-demo architecture

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

- Interactive diagram: https://gitdiagram.com/drhelius/terraform-azure-demo
- Repository: https://github.com/drhelius/terraform-azure-demo

## Overview

##### Project type and purpose
- This is an Infrastructure-as-Code (IaC) demo project using Terraform to provision resources in Azure.
- It also contains a small Dockerized Python “demo server” that Terraform can deploy onto a VM or container host in Azure.

##### File structure
- Top-level Terraform files:
- demo.tf – main resource definitions
- variables.tf – input variables
- output.tf – outputs of the Terraform run
- provision.sh – wrapper script to run Terraform commands
- docker-demo-server/ – folder with the Docker demo app
- docker-demo-server:
- Dockerfile – builds a Python image
- demo.py & requirements.txt – the Python application and its dependencies
- Supporting files:
- demo.tf references docker-demo-server build and deploy
- .gitignore, LICENSE, README.md for project metadata
- demo.tf might call local-exec or remote-exec to deploy the Docker container on the provisioned VM

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Source Repository"
        readme["README.md"]:::metadata
        license["LICENSE"]:::metadata
        gitignore[".gitignore"]:::metadata
        demo_tf["demo.tf"]:::terraform
        var_tf["variables.tf"]:::terraform
        out_tf["output.tf"]:::terraform
        dir_docker["docker-demo-server/"]:::docker
        dockerfile["Dockerfile"]:::docker
        demo_py["demo.py"]:::docker
        reqs["requirements.txt"]:::docker
    end

    click readme "https://github.com/drhelius/terraform-azure-demo/blob/master/README.md"
    click license "https://github.com/drhelius/terraform-azure-demo/tree/master/LICENSE"
    click gitignore "https://github.com/drhelius/terraform-azure-demo/blob/master/.gitignore"
    click demo_tf "https://github.com/drhelius/terraform-azure-demo/blob/master/demo.tf"
    click var_tf "https://github.com/drhelius/terraform-azure-demo/blob/master/variables.tf"
    click out_tf "https://github.com/drhelius/terraform-azure-demo/blob/master/output.tf"
    click dir_docker "https://github.com/drhelius/terraform-azure-demo/tree/master/docker-demo-server/"
    click dockerfile "https://github.com/drhelius/terraform-azure-demo/tree/master/docker-demo-server/Dockerfile"
    click demo_py "https://github.com/drhelius/terraform-azure-demo/blob/master/docker-demo-server/demo.py"
    click reqs "https://github.com/drhelius/terraform-azure-demo/blob/master/docker-demo-server/requirements.txt"

    subgraph "Developer Environment"
        prov["provision.sh"]:::terraform
        cli["Terraform CLI"]:::terraform
    end

    click prov "https://github.com/drhelius/terraform-azure-demo/blob/master/provision.sh"

    prov --> cli
    cli --> init["init"]:::terraform
    cli --> plan["plan"]:::terraform
    cli --> apply["apply"]:::terraform

    apply -->|"calls Azure ARM API"| arm["Azure Resource Manager API"]:::azure

    subgraph "Azure Cloud"
        subgraph "Resource Group"
            rg["Resource Group"]:::azure
            net["Virtual Network"]:::azure
            vm["Azure VM"]:::azure
            rg --> net
            rg --> vm
            vm -->|"runs"| dock_engine["Docker Engine"]:::docker
            dock_engine --> demo_container["Docker Demo Container"]:::docker
            demo_container --> demo_py
        end
    end

    arm --> rg
    apply -->|"builds Docker image on VM"| dock_engine

    demo_container -->|"serves endpoints"| developer["Developer"]:::external
    out_tf -->|"outputs (public IP, connection strings)"| developer

    classDef terraform fill:#e0ffe0,stroke:#0f0,stroke-width:1px
    classDef azure fill:#e0f0ff,stroke:#00f,stroke-width:1px
    classDef docker fill:#fff0e0,stroke:#f80,stroke-width:1px
    classDef metadata fill:#f0f0f0,stroke:#888,stroke-width:1px
    classDef external fill:#ffffff,stroke:#000,stroke-width:1px
```
