File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed
Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change 2828# - Team membership determines which tenant data they see
2929# ============================================================
3030
31- # ---- [MULTI-TENANCY] Tenant Groups ---------------------------
32- # For each entry in var.tenants, Terraform creates a Keycloak group
33- # named "<tenant>-team" (e.g. "webank-team", "azamra-team").
34- #
35- # HOW IT WORKS:
36- # 1. This code creates the group in Keycloak automatically.
37- # 2. You add a user to this group in the Keycloak Admin Console
38- # (or via API). The user can have any role (admin/editor/viewer).
39- # 3. On their next login, the Keycloak JWT contains:
40- # "groups": ["webank-team", "grafana-editors"] ← both signals
41- # 4. Grafana reads the "groups" claim and auto-assigns the user
42- # to the "webank-team" Grafana Team (configured in grafana.tf).
43- # 5. That team can only query Webank-* datasources → isolation enforced.
44- #
45- # To add a new tenant: add its name to var.tenants in terraform.tfvars
46- # and redeploy. NO manual steps in Keycloak or Grafana.
47-
48- resource "keycloak_group" "tenant_teams" {
49- for_each = toset (var. tenants )
50-
51- realm_id = var. keycloak_realm
52- name = " ${ each . key } -team"
53- }
54-
31+ # ---- OPENID Connect Client -----------------------------------
5532
5633# ---- OpenID Connect Client -----------------------------------
5734
You can’t perform that action at this time.
0 commit comments