terraform {
  required_providers {
    zitadel = {
      source  = "zitadel/zitadel"
      version = "2.0.2"
    }
  }
}

resource "zitadel_user_grant" "default" {
  depends_on = [var.wait_on]

  org_id     = var.org_id
  project_id = var.project_id
  user_id    = var.user_id
  role_keys  = var.roles
}

output "installed" {
  value = true
  depends_on = [zitadel_user_grant.default]
}

output "user_grant_id" {
  value = zitadel_user_grant.default.id
}
