-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DXCDT-429:
auth0_resource_server_scope
resource (#589)
* Initial commit for auth0_resource_server_scope resource * Recording test * Stronger tests * Fixing import * Update internal/auth0/resourceserver/resource_scope.go Co-authored-by: Sergiu Ghitea <[email protected]> * Removing mutex * Rerecording test * Fixing docs * Updating migration guide * Update internal/auth0/resourceserver/resource_scope.go * Update docs/resources/resource_server_scope.md --------- Co-authored-by: Will Vedder <[email protected]> Co-authored-by: Sergiu Ghitea <[email protected]>
- Loading branch information
1 parent
ca22016
commit c5f5cef
Showing
10 changed files
with
2,645 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
page_title: "Resource: auth0_resource_server_scope" | ||
description: |- | ||
With this resource, you can manage scopes (permissions) associated with a resource server (API). | ||
--- | ||
|
||
# Resource: auth0_resource_server_scope | ||
|
||
With this resource, you can manage scopes (permissions) associated with a resource server (API). | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "auth0_resource_server" "resource_server" { | ||
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_scope" "read_posts" { | ||
resource_server_identifier = auth0_resource_server.resource_server.identifier | ||
scope = "read:posts" | ||
} | ||
resource "auth0_resource_server_scope" "write_posts" { | ||
resource_server_identifier = auth0_resource_server.resource_server.identifier | ||
scope = "write:posts" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `resource_server_identifier` (String) Identifier of the resource server that the scope (permission) is associated with. | ||
- `scope` (String) Name of the scope (permission). | ||
|
||
### Optional | ||
|
||
- `description` (String) Description of the scope (permission). | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# This resource can be imported by specifying the | ||
# resource identifier and scope name separated by "::" (note the double colon) | ||
# <resourceServerIdentifier>::<scope> | ||
|
||
# | ||
# Example: | ||
terraform import auth0_resource_server_scope.scope "https://api.travel0.com/v1::read:posts" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This resource can be imported by specifying the | ||
# resource identifier and scope name separated by "::" (note the double colon) | ||
# <resourceServerIdentifier>::<scope> | ||
|
||
# | ||
# Example: | ||
terraform import auth0_resource_server_scope.scope "https://api.travel0.com/v1::read:posts" |
21 changes: 21 additions & 0 deletions
21
examples/resources/auth0_resource_server_scope/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
resource "auth0_resource_server" "resource_server" { | ||
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_scope" "read_posts" { | ||
resource_server_identifier = auth0_resource_server.resource_server.identifier | ||
scope = "read:posts" | ||
} | ||
|
||
resource "auth0_resource_server_scope" "write_posts" { | ||
resource_server_identifier = auth0_resource_server.resource_server.identifier | ||
scope = "write:posts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.