With this resource, you can manage user permissions.
resource "auth0_resource_server" "resource_server" {
name = "Example Resource Server (Managed by Terraform)"
identifier = "https://api.example.com"
scopes {
value = "create:foo"
description = "Create foos"
}
scopes {
value = "create:bar"
description = "Create bars"
}
}
resource "auth0_user" "user" {
connection_name = "Username-Password-Authentication"
user_id = "12345"
username = "unique_username"
name = "Firstname Lastname"
nickname = "some.nickname"
email = "test@test.com"
email_verified = true
password = "passpass$12$12"
picture = "https://www.example.com/a-valid-picture-url.jpg"
}
resource "auth0_user_permission" "user_permission_read" {
user_id = auth0_user.user.id
resource_server_identifier = auth0_resource_server.resource_server.identifier
permission = tolist(auth0_resource_server.resource_server.scopes)[0]
}
permission
(String) Name of the permission.resource_server_identifier
(String) Identifier of the resource server that the permission is associated with.user_id
(String) ID of the user to associate the permission to.description
(String) Description of the permission.id
(String) The ID of this resource.resource_server_name
(String) Name of the resource server that the permission is associated with.Import is supported using the following syntax:
# This resource can be imported by specifying the
# user ID, resource identifier and permission name separated by "::" (note the double colon)
# <userID>::<resourceServerIdentifier>::<permission>
#
# Example:
terraform import auth0_user_permission.permission "auth0|111111111111111111111111::https://api.travel0.com/v1::read:posts"