With this resource, you can manage assigned roles for a user.
# Example:
resource "auth0_role" "admin" {
name = "admin"
description = "Administrator"
}
resource "auth0_user" "user" {
connection_name = "Username-Password-Authentication"
username = "unique_username"
name = "Firstname Lastname"
email = "test@test.com"
password = "passpass$12$12"
# Until we remove the ability to operate changes on
# the roles field it is important to have this
# block in the config, to avoid diffing issues.
lifecycle {
ignore_changes = [roles]
}
}
resource "auth0_user_role" "user_roles" {
user_id = auth0_user.user.id
role_id = auth0_role.admin.id
}
role_id
(String) ID of the role assigned to the user.user_id
(String) ID of the user.id
(String) The ID of this resource.role_description
(String) Description of the role.role_name
(String) Name of the role.Import is supported using the following syntax:
# This resource can be imported by specifying the
# user ID and role ID separated by "::" (note the double colon)
# <userID>::<roleID>
#
# Example:
terraform import auth0_user_role.user_role "auth0|111111111111111111111111::role_123"