# azure/terraform-azurerm-caf-enterprise-scale architecture

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

- Interactive diagram: https://gitdiagram.com/azure/terraform-azurerm-caf-enterprise-scale
- Repository: https://github.com/azure/terraform-azurerm-caf-enterprise-scale

## Overview

##### Main Components

a. Management Group Hierarchy (Core Structure):
- Root Management Group
- Platform Management Groups (Platform, Management, Identity, Connectivity)
- Landing Zones Management Group
- Sandbox Management Group
- Decommissioned Management Group
- Custom Landing Zones (Corp, Online, SAP)

b. Resource Deployments:
- Management Resources (Log Analytics, Automation Account)
- Connectivity Resources (Virtual Networks, Firewalls, DNS)
- Identity Resources
- Policy Management System
- Role Assignments and Definitions

**[Root MG] ──┬── [Platform MG] ──┬── [Management MG]**
- [Identity MG]
- [Connectivity MG]
- [Landing Zones MG] ──┬── [Corp MG]
- [Online MG]
- [SAP MG]
- [Sandbox MG]
- [Decommissioned MG]

**Management Hub:**
**[Log Analytics Workspace] ←→ [Automation Account]**
- [Monitoring Solutions]

**Connectivity Hub:**
**[Virtual Networks] ←→ [Azure Firewall]**
- [DNS Zones]
- [Virtual Network Gateways]
- [DDoS Protection]

**Identity Resources:**
**[Identity Services] ←→ [Security Controls]**

##### Important Relationships

- Policy inheritance down the management group hierarchy
- Resource deployments within their respective subscriptions
- Network connectivity between hubs and spokes
- Role assignment flow
- Monitoring and security relationships

##### Additional Details

Annotations for:
- Terraform module structure
- Custom policy and role definitions
- Subscription placement
- Resource deployment options
- Configuration variables

##### Implementation Notes

- Maintain consistent spacing and alignment
- Version information
- Notes for configuration options
- Optional components with distinct borders

##### Modular Design Representation

How the module can be broken down into:
- Core Management Group structure
- Policy Management system
- Resource deployment modules
- RBAC management
- Custom landing zone deployment

Remember to include the telemetry components and note any version-specific features or breaking changes as indicated in the README's notice section.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Management Group Hierarchy
    subgraph MG["Management Group Hierarchy"]
        Root["Root MG"]:::mg
        Platform["Platform MG"]:::mg
        Management["Management MG"]:::mg
        Identity["Identity MG"]:::mg
        Connectivity["Connectivity MG"]:::mg
        LandingZones["Landing Zones MG"]:::mg
        Corp["Corp MG"]:::mg
        Online["Online MG"]:::mg
        SAP["SAP MG"]:::mg
        Sandbox["Sandbox MG"]:::mg
        Decom["Decommissioned MG"]:::mg

        Root --> Platform
        Root --> LandingZones
        Root --> Sandbox
        Root --> Decom
        Platform --> Management
        Platform --> Identity
        Platform --> Connectivity
        LandingZones --> Corp
        LandingZones --> Online
        LandingZones --> SAP
    end

    %% Policy and RBAC System
    subgraph POL["Policy Management System"]
        PolicyDef["Policy Definitions"]:::policy
        PolicyAssign["Policy Assignments"]:::policy
        PolicySet["Policy Set Definitions"]:::policy
        RoleDef["Role Definitions"]:::rbac
        RoleAssign["Role Assignments"]:::rbac
    end

    %% Resource Deployments
    subgraph RES["Resource Deployments"]
        subgraph MAN["Management Resources"]
            LogAnalytics["Log Analytics"]:::resource
            AutoAccount["Automation Account"]:::resource
            Monitoring["Monitoring Solutions"]:::resource
        end

        subgraph CON["Connectivity Resources"]
            VNets["Virtual Networks"]:::resource
            Firewall["Azure Firewall"]:::resource
            DNS["DNS Zones"]:::resource
            VNetGW["Virtual Network Gateways"]:::resource
            DDoS["DDoS Protection"]:::resource
        end

        subgraph ID["Identity Resources"]
            IdentityServices["Identity Services"]:::resource
            SecurityControls["Security Controls"]:::resource
        end
    end

    %% Relationships
    Platform --> PolicyDef
    PolicyDef --> PolicyAssign
    PolicyDef --> PolicySet
    PolicyAssign --> RoleAssign
    RoleDef --> RoleAssign

    Management --> MAN
    Connectivity --> CON
    Identity --> ID

    %% Click Events
    click MG "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/archetypes/lib/archetype_definitions/"
    click Root "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//resources.management_groups.tf"
    click MAN "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/management/"
    click LogAnalytics "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//resources.management.tf"
    click CON "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/connectivity/"
    click VNets "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//resources.connectivity.tf"
    click VNetGW "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//resources.virtual_wan.tf"
    click ID "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/identity/"
    click PolicyDef "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/archetypes/lib/policy_definitions/"
    click PolicyAssign "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/archetypes/lib/policy_assignments/"
    click PolicySet "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/archetypes/lib/policy_set_definitions/"
    click RoleDef "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/archetypes/lib/role_definitions/"
    click RoleAssign "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/tree/main//modules/role_assignments_for_policy/"
    click Corp "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//modules/archetypes/lib/archetype_definitions/archetype_definition_es_corp.tmpl.json"
    click Online "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//modules/archetypes/lib/archetype_definitions/archetype_definition_es_online.tmpl.json"
    click SAP "https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/blob/main//modules/archetypes/lib/archetype_definitions/archetype_definition_es_sap.tmpl.json"

    %% Styles
    classDef mg fill:#4b6584,stroke:#2d3436,color:#fff
    classDef policy fill:#20bf6b,stroke:#0fb9b1,color:#fff
    classDef rbac fill:#8854d0,stroke:#5f27cd,color:#fff
    classDef resource fill:#fa8231,stroke:#fd9644,color:#fff

    %% Legend
    subgraph Legend
        L1["Management Group"]:::mg
        L2["Policy Component"]:::policy
        L3["RBAC Component"]:::rbac
        L4["Azure Resource"]:::resource
    end
```
