mrparkers / terraform-provider-keycloak

Terraform provider for Keycloak
https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs
MIT License
598 stars 292 forks source link

Federation not working when created together with realm #913

Open FWest98 opened 6 months ago

FWest98 commented 6 months ago

When I create an instance of the ldap federation together with a new realm in one operation, the federation provider does not function at all. It does not show in the UI, and it is not picked up anywhere. However, I am able to see its configuration by manually navigating to the URL for managing the provider. The provider will only become active once I make another change to it; such as disabling and re-enabling.

This only seems to happen when both the realm and the federation provider are created in one apply operation. When I first create the realm with -target keycloak_realm.foo, and only then create the provider, then it works without issue.

The issue can (for me) be reproduced with the default example at https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs/resources/ldap_user_federation.

Judging by some SO post, it might have to do with passing the correct parentId, which might be a similar issue to #694?