With this resource, you can manage scopes (permissions) associated with a resource server (API).
resource "auth0_resource_server" "my_api" {
name = "Example Resource Server (Managed by Terraform)"
identifier = "https://api.example.com"
# Until we remove the ability to operate changes on
# the scopes field it is important to have this
# block in the config, to avoid diffing issues.
lifecycle {
ignore_changes = [scopes]
}
}
resource "auth0_resource_server_scopes" "my_api_scopes" {
resource_server_identifier = auth0_resource_server.my_api.identifier
scopes {
name = "create:appointments"
description = "Ability to create appointments"
}
scopes {
name = "read:appointments"
description = "Ability to read appointments"
}
}
resource_server_identifier
(String) Identifier of the resource server that the scopes (permission) are associated with.scopes
(Block Set, Min: 1) (see below for nested schema)id
(String) The ID of this resource.scopes
Required:
name
(String) Name of the scope (permission). Examples include read:appointments
or delete:appointments
.Optional:
description
(String) User-friendly description of the scope (permission).Import is supported using the following syntax:
# This resource can be imported by specifying the resource server identifier.
#
# Example:
terraform import auth0_resource_server_scopes.my_api_scopes "https://api.travel0.com/v1"