With this resource, you can manage all of a user's 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 = "read:foo"
description = "Read foos"
}
}
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_permissions" "all_user_permissions" {
user_id = auth0_user.user.id
permissions {
name = tolist(auth0_resource_server.resource_server.scopes)[0]
resource_server_identifier = auth0_resource_server.resource_server.identifier
}
permissions {
name = tolist(auth0_resource_server.resource_server.scopes)[1]
resource_server_identifier = auth0_resource_server.resource_server.identifier
}
}
permissions
(Block Set, Min: 1) List of API permissions granted to the user. (see below for nested schema)user_id
(String) ID of the user to associate the permission to.id
(String) The ID of this resource.permissions
Required:
name
(String) Name of permission.resource_server_identifier
(String) Resource server identifier associated with the permission.Read-Only:
description
(String) Description of the permission.resource_server_name
(String) Name of 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
# Example:
terraform import auth0_user_permissions.all_user_permissions "auth0|111111111111111111111111"