Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import attribute for keycloak_openid_client #536

Closed
wants to merge 2 commits into from
Closed

Add import attribute for keycloak_openid_client #536

wants to merge 2 commits into from

Conversation

spirius
Copy link
Contributor

@spirius spirius commented May 25, 2021

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)

Copy link
Contributor

@mrparkers mrparkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, I just had one question

}
rootUrlString := data.Get("root_url").(string)
client.Id = existingClient.Id
client.RootUrl = &rootUrlString
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we only setting RootUrl for the client as opposed to other fields. should we just call getOpenidClientFromData here?

@jkurek1
Copy link

jkurek1 commented Aug 26, 2021

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

@zifeo
Copy link

zifeo commented Oct 27, 2021

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

@mrparkers
Copy link
Contributor

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

Thanks for your work on this!

@mrparkers mrparkers closed this Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants