keycloak / terraform-provider-keycloak

Terraform provider for Keycloak
https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs
Apache License 2.0
648 stars 317 forks source link

Consistency: keycloak_openid_client_service_account_role for both realm and client roles #905

Open TBeijen opened 11 months ago

TBeijen commented 11 months ago

Happened to notice a bit of an inconsistency.

When creating a role, providing or omiting client_id distinguishes between realm- and client role: https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs/resources/role#client_id

That works quite nice.

However when needing to reference the role to add to a service account, one needs to work with different resource types:

Those 2 only differ by the client_id attribute that's present in the latter.

This could work in the same way as roles: A single resource type, where optional client_id distinguishes between type of role.

(Admitted, probably 'nice to have' and not top prio, seeing the backlog of issues)