# hmcts/launchdarkly-terraform architecture

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

- Interactive diagram: https://gitdiagram.com/hmcts/launchdarkly-terraform
- Repository: https://github.com/hmcts/launchdarkly-terraform

## Overview

This repository defines Terraform-managed LaunchDarkly projects and access roles. The documented workflow is to add project and Azure AD group values to `terraform.tfvars`, then use the Terraform configuration to manage the LaunchDarkly setup. Projects can be split into admin and member access, with member access restricted on protected environments (production by default). The tree also contains offboarding pipeline assets, but their runtime behavior is not documented here, so they are not mapped as product components.

Main entry points: [`terraform.tfvars`](https://github.com/hmcts/launchdarkly-terraform/blob/master/terraform.tfvars) (Project settings), [`main.tf`](https://github.com/hmcts/launchdarkly-terraform/blob/master/main.tf) (Root configuration), [`modules/ld-scaffold/roles.tf`](https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/roles.tf) (Access roles), [`modules/ld-scaffold/projects.tf`](https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/projects.tf) (Project resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Configuration inputs"]
  node_project_vars["Project settings<br/>[terraform.tfvars]"]
  node_root_vars["Root variables<br/>[variables.tf]"]
end

subgraph group_terraform["Terraform configuration"]
  node_terraform_root["Root configuration<br/>[main.tf]"]
  node_projects["Project resources<br/>[projects.tf]"]
  node_roles["Access roles<br/>[roles.tf]"]
  node_module_vars["Module settings<br/>[variables.tf]"]
end

node_team(("Project maintainer"))
node_ld["LaunchDarkly"]
node_aad["Azure AD groups"]

node_team -->|"edits settings"| node_project_vars
node_project_vars -->|"configures projects"| node_terraform_root
node_terraform_root -->|"manages projects"| node_ld
node_projects -->|"defines projects"| node_ld
node_roles -->|"defines access"| node_ld
node_aad -->|"provides group identities"| node_roles

click node_project_vars "https://github.com/hmcts/launchdarkly-terraform/blob/master/terraform.tfvars"
click node_root_vars "https://github.com/hmcts/launchdarkly-terraform/blob/master/variables.tf"
click node_terraform_root "https://github.com/hmcts/launchdarkly-terraform/blob/master/main.tf"
click node_projects "https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/projects.tf"
click node_roles "https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/roles.tf"
click node_module_vars "https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/variables.tf"

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_project_vars,node_root_vars toneBlue
class node_terraform_root,node_projects,node_roles,node_module_vars toneAmber
class node_team,node_ld,node_aad toneIndigo
```

## Components

### Configuration inputs

- [Project settings](https://github.com/hmcts/launchdarkly-terraform/blob/master/terraform.tfvars): `terraform.tfvars`
- [Root variables](https://github.com/hmcts/launchdarkly-terraform/blob/master/variables.tf): `variables.tf`

### Terraform configuration

- [Root configuration](https://github.com/hmcts/launchdarkly-terraform/blob/master/main.tf): `main.tf`
- [Project resources](https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/projects.tf): `modules/ld-scaffold/projects.tf`
- [Access roles](https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/roles.tf): `modules/ld-scaffold/roles.tf`
- [Module settings](https://github.com/hmcts/launchdarkly-terraform/blob/master/modules/ld-scaffold/variables.tf): `modules/ld-scaffold/variables.tf`

### Other components

- **Project maintainer**
- **LaunchDarkly**
- **Azure AD groups**

## Connections

- Project maintainer → Project settings: edits settings
- Project settings → Root configuration: configures projects
- Root configuration → LaunchDarkly: manages projects
- Project resources → LaunchDarkly: defines projects
- Access roles → LaunchDarkly: defines access
- Azure AD groups → Access roles: provides group identities
