Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data source: keycloak_roles #914

Open
Sander0542 opened this issue Jan 8, 2024 · 0 comments
Open

Data source: keycloak_roles #914

Sander0542 opened this issue Jan 8, 2024 · 0 comments

Comments

@Sander0542
Copy link

Currently, there is a data source for fetching a specific role from a realm (and client). However, there is no way to fetch all the roles for a realm (and client).

data "keycloak_role" "admin" {
  realm_id = data.keycloak_realm.realm.id
  client_id = data.keycloak_openid_client.client.id # Optional
  name = "admin"
}

Possible implementation:

data "keycloak_roles" "realm" {
  realm_id = data.keycloak_realm.realm.id
  client_id = data.keycloak_openid_client.client.id # Optional
}

output "realm_roles" {
  value = data.keycloak_roles.realm.roles
}

Output:

realm_roles = {
  admin = {
    id = "uuid"
    name = "admin"
    description = "description"
  }
  user = {
    ...
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant