terraform-provider-keycloak
terraform-provider-keycloak copied to clipboard
[auth flow] cyclic dependency with a realm => how to fix it simply ? need a dedicated resource ?
Hello,
I do not see how to create with the same TF state :
- an auth flow
- and a realm using this auth flow
The auth flow expects a realm_id and the realm expects the flow_id ....
The example https://github.com/mrparkers/terraform-provider-keycloak/blob/master/example/main.tf does not give any clue, the only example is where an auth flow is assigned to a client... not a realm
What about creating a dedicated resource for example : keycloak_real_auth_flow to fix this simply ? Or do you have any simple workarround ?
Yes, it is a missing feature. In current situation you need to do it in 2 steps
- create realm
- create flow and use a plain text reference to the flow on the realm
And Yes, the solution would be that the flow bindings on a realm are a separate tf resource. This has alreday been discussed somewhere in some other ticket as well. Please feel free to create a PR.
This problem was mentioned in this issue. I've developed a separate resource but haven't had the time to submit the PR with tests and stuff. Meanwhile, you can either use the workaround provided in the ticket or do the job I didn't and submit the PR.