# azure/terraform-ai-gateway-landing-zone architecture

> Architecture diagram of the GitHub repository azure/terraform-ai-gateway-landing-zone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/terraform-ai-gateway-landing-zone
- Repository: https://github.com/azure/terraform-ai-gateway-landing-zone

## Overview

This repository provides a Terraform-based Azure AI Gateway Landing Zone. Its principal user workflow is to configure and deploy the Azure infrastructure, then send model requests through API Management (APIM) to configured AI backends; usage data can also be ingested and reported. Documented capabilities include model discovery and compatibility APIs, access contracts, backend onboarding, monitoring, and network/security support. The graph reflects README-level architecture; source excerpts mainly cover shared Python helpers, so detailed Terraform and workflow connections are not asserted.

Main entry points: [`main.tf`](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/main.tf) (Terraform deployment), [`modules/apim/main.tf`](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/apim/main.tf) (API Management gateway), [`logicapp-src/usage-ingestion-logicapp`](https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/logicapp-src/usage-ingestion-logicapp) (Usage ingestion workflows), [`modules/cosmosdb/main.tf`](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/cosmosdb/main.tf) (Usage and pricing data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["AI gateway"]
  node_apim["API Management gateway<br/>[main.tf]"]
  node_api_specs["AI API definitions"]
  node_policies["Gateway policies"]
end

subgraph group_platform["Azure platform"]
  node_terraform["Terraform deployment<br/>[main.tf]"]
  node_network["Network and private endpoints<br/>[main.tf]"]
  node_identity["Entra ID and security<br/>[main.tf]"]
  node_backends["AI Foundry backends<br/>[main.tf]"]
  node_monitoring["Monitoring and dashboards<br/>[main.tf]"]
end

subgraph group_usage["Usage analytics"]
  node_eventhub["Usage event hub<br/>[main.tf]"]
  node_ingestion["Usage ingestion workflows"]
  node_cosmos[("Usage and pricing data<br/>[main.tf]")]
  node_reports["Usage reports"]
end

subgraph group_onboarding["Onboarding"]
  node_contracts["Access contracts<br/>[main.tf]"]
  node_llm_onboarding["LLM backend onboarding<br/>[main.tf]"]
end

subgraph group_helpers["Shared helpers"]
  node_apimtools["APIM management tools<br/>[apimtools.py]"]
  node_utils["Environment and CLI helpers<br/>[utils.py]"]
end

node_engineer(("Platform engineer"))
node_client(("API client"))

node_engineer -->|"configures and deploys"| node_terraform
node_terraform -->|"provisions"| node_network
node_terraform -->|"provisions"| node_identity
node_terraform -->|"provisions"| node_apim
node_terraform -->|"provisions"| node_backends
node_terraform -->|"provisions"| node_eventhub
node_terraform -->|"provisions"| node_ingestion
node_terraform -->|"provisions"| node_cosmos
node_terraform -->|"provisions"| node_monitoring
node_client -->|"sends model requests"| node_apim
node_apim -->|"exposes APIs"| node_api_specs
node_apim -->|"applies policies"| node_policies
node_apim -->|"routes requests"| node_backends
node_ingestion -->|"stores usage data"| node_cosmos
node_ingestion -->|"ingests usage events"| node_eventhub
node_cosmos -.->|"supplies report data"| node_reports
node_engineer -->|"onboards backends"| node_llm_onboarding
node_engineer -->|"provisions team access"| node_contracts
node_apimtools -->|"uses helpers"| node_utils

click node_terraform "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/main.tf"
click node_network "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/networking/main.tf"
click node_identity "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/entra-id/main.tf"
click node_apim "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/apim/main.tf"
click node_api_specs "https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/modules/apim"
click node_policies "https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/modules/apim/policies"
click node_backends "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/foundry/main.tf"
click node_contracts "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/citadel-access-contracts/main.tf"
click node_llm_onboarding "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/llm-backend-onboarding/main.tf"
click node_eventhub "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/eventhub/main.tf"
click node_ingestion "https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/logicapp-src/usage-ingestion-logicapp"
click node_cosmos "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/cosmosdb/main.tf"
click node_reports "https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/logicapp-src/usage-reports"
click node_monitoring "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/monitoring/main.tf"
click node_apimtools "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/shared/apimtools.py"
click node_utils "https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/shared/utils.py"

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_apim,node_api_specs,node_policies,node_client toneBlue
class node_terraform,node_network,node_identity,node_backends,node_monitoring toneAmber
class node_eventhub,node_ingestion,node_cosmos,node_reports toneMint
class node_contracts,node_llm_onboarding toneRose
class node_apimtools,node_utils,node_engineer toneIndigo
```

## Components

### AI gateway

- [API Management gateway](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/apim/main.tf): `modules/apim/main.tf`
- [AI API definitions](https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/modules/apim): `modules/apim`
- [Gateway policies](https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/modules/apim/policies): `modules/apim/policies`

### Azure platform

- [Terraform deployment](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/main.tf): `main.tf`
- [Network and private endpoints](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/networking/main.tf): `modules/networking/main.tf`
- [Entra ID and security](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/entra-id/main.tf): `modules/entra-id/main.tf`
- [AI Foundry backends](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/foundry/main.tf): `modules/foundry/main.tf`
- [Monitoring and dashboards](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/monitoring/main.tf): `modules/monitoring/main.tf`

### Usage analytics

- [Usage event hub](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/eventhub/main.tf): `modules/eventhub/main.tf`
- [Usage ingestion workflows](https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/logicapp-src/usage-ingestion-logicapp): `logicapp-src/usage-ingestion-logicapp`
- [Usage and pricing data](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/modules/cosmosdb/main.tf): `modules/cosmosdb/main.tf`
- [Usage reports](https://github.com/azure/terraform-ai-gateway-landing-zone/tree/main/logicapp-src/usage-reports): `logicapp-src/usage-reports`

### Onboarding

- [Access contracts](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/citadel-access-contracts/main.tf): `citadel-access-contracts/main.tf`
- [LLM backend onboarding](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/llm-backend-onboarding/main.tf): `llm-backend-onboarding/main.tf`

### Shared helpers

- [APIM management tools](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/shared/apimtools.py): `shared/apimtools.py`
- [Environment and CLI helpers](https://github.com/azure/terraform-ai-gateway-landing-zone/blob/main/shared/utils.py): `shared/utils.py`

### Other components

- **Platform engineer**
- **API client**

## Connections

- Platform engineer → Terraform deployment: configures and deploys (evidence: `README.md`)
- Terraform deployment → Network and private endpoints: provisions (evidence: `README.md`)
- Terraform deployment → Entra ID and security: provisions (evidence: `README.md`)
- Terraform deployment → API Management gateway: provisions (evidence: `README.md`)
- Terraform deployment → AI Foundry backends: provisions (evidence: `README.md`)
- Terraform deployment → Usage event hub: provisions (evidence: `README.md`)
- Terraform deployment → Usage ingestion workflows: provisions (evidence: `README.md`)
- Terraform deployment → Usage and pricing data: provisions (evidence: `README.md`)
- Terraform deployment → Monitoring and dashboards: provisions (evidence: `README.md`)
- API client → API Management gateway: sends model requests (evidence: `README.md`)
- API Management gateway → AI API definitions: exposes APIs (evidence: `README.md`)
- API Management gateway → Gateway policies: applies policies (evidence: `README.md`)
- API Management gateway → AI Foundry backends: routes requests (evidence: `README.md`)
- Usage ingestion workflows → Usage and pricing data: stores usage data (evidence: `README.md`)
- Usage ingestion workflows → Usage event hub: ingests usage events (evidence: `README.md`)
- Usage and pricing data → Usage reports: supplies report data
- Platform engineer → LLM backend onboarding: onboards backends (evidence: `README.md`)
- Platform engineer → Access contracts: provisions team access (evidence: `README.md`)
- APIM management tools → Environment and CLI helpers: uses helpers (evidence: `shared/apimtools.py`)
