terraform-provider-keycloak icon indicating copy to clipboard operation
terraform-provider-keycloak copied to clipboard

Add import attribute for keycloak_openid_client

Open spirius opened this issue 3 years ago • 2 comments

Keycloak creates few openid clients by default (like account, account-console) and the only way to manage those clients with terraform is by manual import. This PR adds import attribute to keycloak_openid_client resources, which controls whether or not the client should be created or "imported". Note, that if import attribute is true, the resource will not be removed during destruction.

With this change, for example, one can disable the account client with a configuration like this:

resource "keycloak_realm" "realm" {
  realm = "test-realm"
}

resource "keycloak_openid_client" "account" {
  realm_id    = keycloak_realm.realm.id
  client_id   = "account"
  access_type = "PUBLIC"
  enabled     = false
  import      = true
}

Acceptance tests:

=== RUN   TestAccKeycloakOpenidClient_import
=== PAUSE TestAccKeycloakOpenidClient_import
=== CONT  TestAccKeycloakOpenidClient_import
--- PASS: TestAccKeycloakOpenidClient_import (19.38s)

spirius avatar May 25 '21 15:05 spirius

Hi, How about this pull request? It is still valid? I need this feature.

jkurek1 avatar Aug 26 '21 21:08 jkurek1

@spirius Nice PR, is there something preventing to move forward?

zifeo avatar Oct 27 '21 19:10 zifeo

I made some changes to this and opened a new PR #747.

Thanks for your work on this!

mrparkers avatar Oct 06 '22 22:10 mrparkers