Skip to content
New issue

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

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

Already on GitHub? # to your account

data keycloak_group fails with nested group #333

Closed
chanhht opened this issue Jul 1, 2020 · 0 comments
Closed

data keycloak_group fails with nested group #333

chanhht opened this issue Jul 1, 2020 · 0 comments

Comments

@chanhht
Copy link
Contributor

chanhht commented Jul 1, 2020

When trying data keycloak_group with the nested group, it returns an error
Step to reproduce:

// First, run a TF apply for groups creation
data "keycloak_realm" "realm" {
    realm   = "master"
}

resource "keycloak_group" "parent_group" {
    realm_id = data.keycloak_realm.realm.id
    name     = "parent-group"
}

resource "keycloak_group" "child_group" {
    realm_id  = data.keycloak_realm.realm.id
    parent_id = keycloak_group.parent_group.id
    name      = "child-group"
}

// Then run another TF plan/apply for query groups by datasource
data "keycloak_group" "parent_group" {
    realm_id = data.keycloak_realm.realm.id
    name     = "parent-group"
}

data "keycloak_group" "child_group" {
    realm_id = data.keycloak_realm.realm.id
    name     = "child-group"
}

Then received this error:

Error: no group with name child-group found

  on keycloak_test.tf line 30, in data "keycloak_group" "child_group":
  30: data "keycloak_group" "child_group" {

Both groups are present in Keycloak after the first creation run.

Originally posted by @chanhht in #330 (comment)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant