mrparkers / terraform-provider-keycloak

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

Make it possible to import keycloak_ldap_user_federation with custom delete_default_mappers flag #851

Open MatrixCrawler opened 1 year ago

MatrixCrawler commented 1 year ago

We want to be able to import keycloak_ldap_user_federation with a custom delete_default_mappers flag.

We have the use case that we have a bunch of existing ldap federations that are NOT using the default mappers and we want to create new user federations without the default mappers too. The problem is, that we want the flag to be globally the same (we are using a tf module) and don't want to set it per federation. I checked th code at https://github.com/mrparkers/terraform-provider-keycloak/blob/5680aa0d0fe78a6ccaeea113e6fb6c825ad557e3/provider/resource_keycloak_ldap_user_federation.go#L574 and realised that the import will always import the flag as false. As result keycloak want's to delete and recreate the mappers after import. We dont't want that to happen.