# sathish-katakam/azure-cloudplatform architecture

> Architecture diagram of the GitHub repository sathish-katakam/azure-cloudplatform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sathish-katakam/azure-cloudplatform
- Repository: https://github.com/sathish-katakam/azure-cloudplatform

## Overview

1. This repository is an Azure platform automation workspace centered on Terraform Cloud. Its job is to split a shared management configuration into per-LOB Terraform Cloud workspaces, then let those workspaces provision Azure infrastructure.

2. The main source of truth is `locals.tf`. It contains the nested configuration for environments (`npe`, `prd`) and each line of business. The automation reads that file, extracts the requested LOB, and turns it into workspace-specific inputs.

3. The orchestration path starts in `.github/workflows/split-workspace.yml`. A human triggers it with an environment and LOB name. The workflow normalizes inputs, runs the Python asset-preparation step, commits generated files, and then invokes the workspace-management script.

4. `plz-automation-scripts/mgmt-split-workspace-trigger/main.py` is the control-plane entrypoint. It verifies the management workspace exists, selects only the requested LOB, and coordinates Terraform Cloud workspace creation/update and run triggering. It does not deploy Azure resources itself; it manages the Terraform Cloud boundary.

5. `plz-automation-scripts/modules/terraform_apis.py` is the integration layer to Terraform Cloud. It performs workspace lookup, run triggering, and run monitoring, which makes Terraform Cloud the execution engine for the actual infrastructure changes.

6. `plz-automation-scripts/mgmt-split-workspace-trigger/prepare_lob_assets.py` is the data-shaping step. It generates and refreshes per-environment/per-LOB JSON artifacts under `line-of-businesses/`, `platform-landing-zones/`, and `systemnodepools/`, plus CIDR-related docs. Those generated files are then used to sync workspace variables.

7. The repo is structured around two major Terraform layers: platform and LOB. `terraform/platform` and `terraform/modules/platform` define shared foundation capabilities, while `terraform/lob` and `terraform/modules/lob` define the per-LOB workload stack. The README makes the intended boundary explicit: platform owns shared foundation; LOB consumes it.

8. The LOB Terraform path is the repeated operational path. The LOB workspace runs from `terraform/lob`, which calls `terraform/modules/lob`. That module creates Azure workload infrastructure such as resource groups, Log Analytics workspaces, VNets, subnets, NSGs, and AKS-related networking.

9. The platform path is a bootstrap/shared-services path. It is created less often and is meant to establish environment-level foundations such as shared networking, governance, identity, and Terraform Cloud workspace structure. LOB workspaces then consume the platform outputs rather than rebuilding the same foundation.

10. The repo also contains other Terraform roots that look like separate operational domains: `terraform/landing-zone`, `terraform/app-foundation`, `terraform/aks`, `terraform/addons`, and `terraform/lob`, each with matching reusable modules in `terraform/modules/`. This suggests a layered platform model rather than a single monolithic Terraform stack.

11. The generated JSON directories under `line-of-businesses/`, `platform-landing-zones/`, and `systemnodepools/` are important integration artifacts. They act as the bridge between the shared config and the per-workspace Terraform variables that Terraform Cloud consumes during plan/apply.

12. The key external boundary is Terraform Cloud, which then talks to Azure through the Terraform Azure provider. The README notes that real Azure deployment depends on Terraform Cloud environment variables such as `ARM_CLIENT_ID`, `ARM_CLIENT_SECRET`, `ARM_SUBSCRIPTION_ID`, and `ARM_TENANT_ID`, so Azure authentication is part of the deployment boundary, not the repository itself.

13. Architecturally, the data flow is: engineer updates `locals.tf` → GitHub Actions runs split-workspace automation → JSON assets and workspace variables are generated/synced → Terraform Cloud workspace is created/updated → Terraform executes Azure infrastructure changes. That is the core loop to draw in an architecture diagram.

14. A useful diagram boundary is to separate “control plane” from “infrastructure plane.” The control plane is GitHub Actions plus the Python/Terraform Cloud API automation; the infrastructure plane is the Terraform Cloud-managed Terraform roots/modules that provision Azure resources for platform and LOBs.

Main entry points: [`plz-automation-scripts/mgmt-split-workspace-trigger/main.py`](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/mgmt-split-workspace-trigger/main.py) (Workspace trigger), [`plz-automation-scripts/mgmt-split-workspace-trigger/prepare_lob_assets.py`](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/mgmt-split-workspace-trigger/prepare_lob_assets.py) (Prepare assets), [`.github/workflows/split-workspace.yml`](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/.github/workflows/split-workspace.yml) (Split workflow), [`plz-automation-scripts/modules/terraform_apis.py`](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/terraform_apis.py) (TFC APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control_plane["Control plane"]
  node_locals_tf["locals.tf<br/>source config<br/>[locals.tf]"]
  node_split_workflow["Split workflow<br/>GitHub Actions"]
  node_prepare_assets["Prepare assets<br/>Python shaping"]
  node_mgmt_trigger["Workspace trigger<br/>control plane<br/>[main.py]"]
  node_tfc_api["TFC APIs<br/>Terraform Cloud integration<br/>[terraform_apis.py]"]
  node_platform_ws["Platform ws<br/>workspace helpers<br/>[workspaces.py]"]
  node_lob_ws["LOB ws<br/>workspace helpers<br/>[workspaces.py]"]
end

subgraph group_infra_plane["Infrastructure plane"]
  node_platform_root["Platform root<br/>Terraform root"]
  node_platform_module["Platform module<br/>Terraform module"]
  node_landing_root["Landing zone<br/>Terraform root"]
  node_landing_module["Landing module<br/>Terraform module"]
  node_app_root["App foundation<br/>Terraform root"]
  node_app_module["App module<br/>Terraform module"]
  node_lob_root["LOB root<br/>Terraform root"]
  node_lob_module["LOB module<br/>Terraform module"]
  node_aks_root["AKS root<br/>Terraform root"]
  node_aks_module["AKS module<br/>Terraform module"]
  node_addons_root["Addons root<br/>Terraform root"]
  node_addons_module["Addons module<br/>Terraform module"]
  node_azure(("Azure<br/>cloud provider"))
end

subgraph group_generated_data["Generated artifacts"]
  node_lob_json["LOB JSON<br/>generated inputs"]
  node_plz_json["PLZ JSON<br/>generated inputs"]
  node_snp_json["Nodepool JSON<br/>generated inputs"]
end

node_locals_tf -->|"shared config"| node_split_workflow
node_split_workflow -->|"prepare"| node_prepare_assets
node_prepare_assets -->|"write"| node_lob_json
node_prepare_assets -->|"write"| node_plz_json
node_prepare_assets -->|"write"| node_snp_json
node_split_workflow -->|"invoke"| node_mgmt_trigger
node_mgmt_trigger -->|"manage"| node_tfc_api
node_tfc_api -->|"platform"| node_platform_ws
node_tfc_api -->|"lob"| node_lob_ws
node_platform_ws -->|"sync vars"| node_plz_json
node_lob_ws -->|"sync vars"| node_lob_json
node_lob_ws -->|"sync vars"| node_snp_json
node_mgmt_trigger -->|"create/update"| node_platform_root
node_mgmt_trigger -->|"create/update"| node_lob_root
node_platform_root -->|"uses"| node_platform_module
node_landing_root -->|"uses"| node_landing_module
node_app_root -->|"uses"| node_app_module
node_lob_root -->|"uses"| node_lob_module
node_aks_root -->|"uses"| node_aks_module
node_addons_root -->|"uses"| node_addons_module
node_platform_module -->|"provisions"| node_azure
node_landing_module -->|"provisions"| node_azure
node_app_module -->|"provisions"| node_azure
node_lob_module -->|"provisions"| node_azure
node_aks_module -->|"provisions"| node_azure
node_addons_module -->|"provisions"| node_azure
node_mgmt_trigger -.->|"platform boundary"| node_platform_root
node_mgmt_trigger -.->|"lob boundary"| node_lob_root

click node_locals_tf "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/locals.tf"
click node_split_workflow "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/.github/workflows/split-workspace.yml"
click node_prepare_assets "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/mgmt-split-workspace-trigger/prepare_lob_assets.py"
click node_mgmt_trigger "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/mgmt-split-workspace-trigger/main.py"
click node_tfc_api "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/terraform_apis.py"
click node_platform_ws "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/platform/workspaces.py"
click node_lob_ws "https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/lob/workspaces.py"
click node_lob_json "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/line-of-businesses"
click node_plz_json "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/platform-landing-zones"
click node_snp_json "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/systemnodepools"
click node_platform_root "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/platform"
click node_platform_module "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/platform"
click node_landing_root "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/landing-zone"
click node_landing_module "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/landing-zone"
click node_app_root "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/app-foundation"
click node_app_module "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/app-foundation"
click node_lob_root "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/lob"
click node_lob_module "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/lob"
click node_aks_root "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/aks"
click node_aks_module "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/aks"
click node_addons_root "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/addons"
click node_addons_module "https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/addons"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_locals_tf,node_split_workflow,node_prepare_assets,node_mgmt_trigger,node_tfc_api,node_platform_ws,node_lob_ws toneBlue
class node_platform_root,node_platform_module,node_landing_root,node_landing_module,node_app_root,node_app_module,node_lob_root,node_lob_module,node_aks_root,node_aks_module,node_addons_root,node_addons_module,node_azure toneAmber
class node_lob_json,node_plz_json,node_snp_json toneMint
```

## Components

### Control plane

Human-triggered automation that splits shared config and manages Terraform Cloud workspaces.

- [locals.tf](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/locals.tf): source config · Shared management configuration and the source of truth for environments and line-of-business definitions. · `locals.tf`
- [Split workflow](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/.github/workflows/split-workspace.yml): GitHub Actions · Manual orchestration entrypoint that normalizes inputs, prepares assets, commits generated files, and triggers workspace management. · `.github/workflows/split-workspace.yml`
- [Prepare assets](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/mgmt-split-workspace-trigger/prepare_lob_assets.py): Python shaping · Extracts the requested LOB from shared config and refreshes per-environment JSON artifacts and CIDR-related docs. · `plz-automation-scripts/mgmt-split-workspace-trigger/prepare_lob_assets.py`
- [Workspace trigger](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/mgmt-split-workspace-trigger/main.py): control plane · Verifies the management workspace, selects the requested LOB, and coordinates Terraform Cloud workspace creation, update, and run triggering. · `plz-automation-scripts/mgmt-split-workspace-trigger/main.py`
- [TFC APIs](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/terraform_apis.py): Terraform Cloud integration · Workspace lookup, variable sync, run triggering, and run monitoring against Terraform Cloud. · `plz-automation-scripts/modules/terraform_apis.py`
- [Platform ws](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/platform/workspaces.py): workspace helpers · Platform workspace shaping and variable wiring used by the management automation. · `plz-automation-scripts/modules/platform/workspaces.py`
- [LOB ws](https://github.com/sathish-katakam/azure-cloudplatform/blob/main/plz-automation-scripts/modules/lob/workspaces.py): workspace helpers · LOB workspace shaping and variable wiring used by the management automation. · `plz-automation-scripts/modules/lob/workspaces.py`

### Infrastructure plane

Terraform roots and reusable modules that Terraform Cloud uses to provision Azure.

- [Platform root](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/platform): Terraform root · Shared foundation stack for environment-level networking, governance, identity, and workspace structure. · `terraform/platform`
- [Platform module](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/platform): Terraform module · Reusable implementation for the shared platform foundation. · `terraform/modules/platform`
- [Landing zone](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/landing-zone): Terraform root · Separate operational domain for landing-zone provisioning. · `terraform/landing-zone`
- [Landing module](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/landing-zone): Terraform module · Reusable implementation for landing-zone resources. · `terraform/modules/landing-zone`
- [App foundation](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/app-foundation): Terraform root · Application foundation layer for environment-specific workload prerequisites. · `terraform/app-foundation`
- [App module](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/app-foundation): Terraform module · Reusable implementation for app-foundation resources. · `terraform/modules/app-foundation`
- [LOB root](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/lob): Terraform root · Per-LOB operational path that consumes platform outputs and provisions workload infrastructure. · `terraform/lob`
- [LOB module](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/lob): Terraform module · Creates workload infrastructure such as resource groups, Log Analytics, VNets, subnets, NSGs, and AKS networking. · `terraform/modules/lob`
- [AKS root](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/aks): Terraform root · Dedicated AKS stack for cluster-related provisioning. · `terraform/aks`
- [AKS module](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/aks): Terraform module · Reusable implementation for AKS resources. · `terraform/modules/aks`
- [Addons root](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/addons): Terraform root · Operational domain for add-on provisioning. · `terraform/addons`
- [Addons module](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/terraform/modules/addons): Terraform module · Reusable implementation for add-on resources. · `terraform/modules/addons`
- **Azure**: cloud provider · Target cloud where Terraform Cloud executes infrastructure changes using Azure credentials.

### Generated artifacts

Per-environment and per-LOB JSON inputs produced from shared configuration.

- [LOB JSON](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/line-of-businesses): generated inputs · Per-environment and per-LOB artifacts under line-of-businesses/ that feed workspace variables. · `line-of-businesses`
- [PLZ JSON](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/platform-landing-zones): generated inputs · Per-environment platform-landing-zones artifacts used to sync platform workspace variables. · `platform-landing-zones`
- [Nodepool JSON](https://github.com/sathish-katakam/azure-cloudplatform/tree/main/systemnodepools): generated inputs · Per-environment systemnodepools artifacts used by the split-workspace automation. · `systemnodepools`

## Connections

- locals.tf → Split workflow: shared config · Workflow starts from the shared management configuration.
- Split workflow → Prepare assets: prepare · Triggered workflow runs the asset-preparation step.
- Prepare assets → LOB JSON: write · Generates per-LOB JSON artifacts.
- Prepare assets → PLZ JSON: write · Generates platform landing-zone JSON artifacts.
- Prepare assets → Nodepool JSON: write · Generates system nodepool JSON artifacts.
- Split workflow → Workspace trigger: invoke · Workflow hands off to the workspace-management entrypoint.
- Workspace trigger → TFC APIs: manage · Entrypoint uses Terraform Cloud APIs to look up workspaces, sync variables, and trigger runs.
- TFC APIs → Platform ws: platform · API layer supports platform workspace management.
- TFC APIs → LOB ws: lob · API layer supports LOB workspace management.
- Platform ws → PLZ JSON: sync vars · Platform workspace inputs are derived from generated platform artifacts.
- LOB ws → LOB JSON: sync vars · LOB workspace inputs are derived from generated LOB artifacts.
- LOB ws → Nodepool JSON: sync vars · LOB workflow also consumes nodepool artifacts when needed.
- Workspace trigger → Platform root: create/update · Management automation coordinates platform workspace lifecycle.
- Workspace trigger → LOB root: create/update · Management automation coordinates LOB workspace lifecycle.
- Platform root → Platform module: uses · Platform root delegates implementation to the reusable module.
- Landing zone → Landing module: uses · Landing-zone root delegates implementation to the reusable module.
- App foundation → App module: uses · App foundation root delegates implementation to the reusable module.
- LOB root → LOB module: uses · LOB root delegates implementation to the reusable module.
- AKS root → AKS module: uses · AKS root delegates implementation to the reusable module.
- Addons root → Addons module: uses · Addons root delegates implementation to the reusable module.
- Platform module → Azure: provisions · Shared platform foundation is applied in Azure.
- Landing module → Azure: provisions · Landing-zone resources are applied in Azure.
- App module → Azure: provisions · App foundation resources are applied in Azure.
- LOB module → Azure: provisions · LOB workload infrastructure is applied in Azure.
- AKS module → Azure: provisions · AKS resources are applied in Azure.
- Addons module → Azure: provisions · Add-on resources are applied in Azure.
- Workspace trigger → Platform root: platform boundary · Platform is the shared foundation boundary consumed by downstream workspaces.
- Workspace trigger → LOB root: lob boundary · LOB is the repeated operational boundary that provisions workload infrastructure.
