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

[Feature Request] Add an 'import' option for keycloak_realm resources, similar to keycloak_client #794

Open
tculp opened this issue Jan 13, 2023 · 3 comments

Comments

@tculp
Copy link

tculp commented Jan 13, 2023

keycloak_client objects have an 'import' property, which allows one to configure various parameters of clients that were not created by terraform. This type of capability would be useful to have for realms too, especially for the sake of configuring options on the master realm.

This would also solve needs such as #597, without requiring the manual terraform import step and introducing a risk of accidentally deleting the master realm.

@mweibel
Copy link

mweibel commented May 17, 2023

I started with an implementation here: master...mweibel:terraform-provider-keycloak:realm-import

I had issues with importing the master realm afterwards, a second apply would then yield a diff:

 # module.test.keycloak_realm.master will be updated in-place
  ~ resource "keycloak_realm" "master" {
      - default_signature_algorithm              = "RS256" -> null
      - display_name                             = "Keycloak" -> null
      - display_name_html                        = "<div class=\"kc-logo-text\"><span>Keycloak</span></div>" -> null
        id                                       = "master"
        # (44 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

not sure why exactly and didn't find out why before my self-allotted time run out. If anyone wants to continue from here feel free :)

PS: create a ~/.terraformrc with dev_overrides pointing to your local clone to test this (make sure to run make build, too).

@dsmorse
Copy link

dsmorse commented Mar 15, 2024

now that terraform supports the import option natively, this feels redundant I was able to natively to do this:
import { id = "master" to = keycloak_realm.master }

@tculp
Copy link
Author

tculp commented Mar 18, 2024

The different an 'import' option would still have over the native terraform import is allowing destroys without deleting the realm

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

No branches or pull requests

3 participants