diff --git a/docs/resources/required_action.md b/docs/resources/required_action.md index 9ca6901a6..554b03feb 100644 --- a/docs/resources/required_action.md +++ b/docs/resources/required_action.md @@ -19,9 +19,13 @@ resource "keycloak_realm" "realm" { resource "keycloak_required_action" "required_action" { realm_id = keycloak_realm.realm.realm - alias = "webauthn-register" + alias = "UPDATE_PASSWORD" enabled = true - name = "Webauthn Register" + name = "Update Password" + + config = { + max_auth_age = "600" + } } ``` @@ -33,6 +37,7 @@ resource "keycloak_required_action" "required_action" { - `enabled` - (Optional) When `false`, the required action is not enabled for new users. Defaults to `false`. - `default_action` - (Optional) When `true`, the required action is set as the default action for new users. Defaults to `false`. - `priority`- (Optional) The priority of the required action. +- `config`- (Optional) The configuration. Keys are specific to each configurable required action and not checked when applying. ## Import diff --git a/example/main.tf b/example/main.tf index ceb8796b0..966b27153 100644 --- a/example/main.tf +++ b/example/main.tf @@ -109,6 +109,17 @@ resource "keycloak_required_action" "custom-terms-and-conditions" { name = "Custom Terms and Conditions" } +resource "keycloak_required_action" "update-password" { + realm_id = keycloak_realm.test.realm + alias = "UPDATE_PASSWORD" + default_action = true + enabled = true + name = "Update Password" + + config { + max_auth_age = "600" + } +} resource "keycloak_required_action" "custom-configured_totp" { realm_id = keycloak_realm.test.realm alias = "CONFIGURE_TOTP" @@ -427,25 +438,25 @@ resource "keycloak_ldap_full_name_mapper" "full_name_mapper" { } resource "keycloak_ldap_custom_mapper" "custom_mapper" { - name = "custom-mapper" - realm_id = keycloak_ldap_user_federation.openldap.realm_id - ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id + name = "custom-mapper" + realm_id = keycloak_ldap_user_federation.openldap.realm_id + ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id - provider_id = "msad-user-account-control-mapper" - provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper" + provider_id = "msad-user-account-control-mapper" + provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper" } resource "keycloak_ldap_custom_mapper" "custom_mapper_with_config" { - name = "custom-mapper-with-config" - realm_id = keycloak_ldap_user_federation.openldap.realm_id - ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id - - provider_id = "user-attribute-ldap-mapper" - provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper" - config = { - "user.model.attribute" = "username" - "ldap.attribute" = "cn" - } + name = "custom-mapper-with-config" + realm_id = keycloak_ldap_user_federation.openldap.realm_id + ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id + + provider_id = "user-attribute-ldap-mapper" + provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper" + config = { + "user.model.attribute" = "username" + "ldap.attribute" = "cn" + } }