terraform-provider-keycloak
terraform-provider-keycloak copied to clipboard
[authz] TF destroy does not work when scope was associated to resources
Hello,
a TF destroy raises the following error :
Error: error sending DELETE request to /auth/admin/realms/demo-uma/clients/1b73db47-8694-40fb-a4aa-c6e415db8782/authz/resource-server/scope/f393e83d-119d-4635-9834-e7fcaeb998f4: 400 Bad Request. Response body: {"errorMessage":"Scopes can not be removed while associated with resources."}
Error: error sending DELETE request to /auth/admin/realms/demo-uma/clients/1b73db47-8694-40fb-a4aa-c6e415db8782/authz/resource-server/scope/115016ea-b9eb-4dfe-9fba-21dc0ae1f213: 400 Bad Request. Response body: {"errorMessage":"Scopes can not be removed while associated with resources."}
It looks like the relationship between Authz scopes and Authz ressources is not deleted before deleting the TF ressources thenselves.
Workarround was to execute F destroy twice.
Could you provide me with some sample HCL that reproduces this?