-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Description
Describe the bug
Description
When creating a user with the keycloak_user resource and setting attributes, they appear in the first terraform plan output, but are not created in Keycloak after the first apply. No error is shown. Running plan and apply a second time applies the missing attributes successfully.
Terraform Configuration
resource "keycloak_user" "user" {
for_each = local.keycloak_spec["keycloak_users"]
realm_id = keycloak_realm.name.id
username = each.key
enabled = local.enable_local_users
email = lookup(each.value , "email", "${each.key}@${each.key}.com")
email_verified = lookup(each.value , "email_verified", false)
first_name = lookup(each.value , "first_name", each.key)
last_name = lookup(each.value , "last_name", each.key)
attributes = {
role = each.value["role"]
phoneNumber = lookup(each.value , "phoneNumber", "0000000000")
}
initial_password {
value = random_password.keycloak_users_secrets[each.key].result
temporary = false
}
}First plan output:
# module.keycloak_seed.keycloak_user.user["user1"] will be created
+ attributes = {
"phoneNumber" = "0000000000"
"role" = "AccountAdmin"
}
+ other fields...
Second plan output:
# module.keycloak_seed.keycloak_user.user["user1"] will be updated in-place
! attributes = {
"phoneNumber" = "0000000000"
"role" = "AccountAdmin"
}
Version
24.0.4
Expected behavior
The attributes should be created after the first apply, or an error message should be displayed.
Actual behavior
No error message is displayed, and the attributes are only created after the second attempt.
How to Reproduce?
No response
Anything else?
No response
stepan111 and bakarJc
Metadata
Metadata
Assignees
Labels
No labels