-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new observe_grant resource (#160)
- Loading branch information
1 parent
3bf6b24
commit 69283be
Showing
16 changed files
with
774 additions
and
12 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,93 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "observe_grant Resource - terraform-provider-observe" | ||
subcategory: "" | ||
description: |- | ||
NOTE: This feature is still under development. It is not meant for customer use yet. | ||
Manages an Observe grant. Grants allow configuring permissions for users and groups by | ||
assigning roles. A grant may also optionally be qualified by an object id. Replaces | ||
rbac_statement. Reach out to Observe to enable this feature. | ||
--- | ||
# observe_grant | ||
|
||
NOTE: This feature is still under development. It is not meant for customer use yet. | ||
|
||
Manages an Observe grant. Grants allow configuring permissions for users and groups by | ||
assigning roles. A grant may also optionally be qualified by an object id. Replaces | ||
rbac_statement. Reach out to Observe to enable this feature. | ||
## Example Usage | ||
```terraform | ||
data "observe_workspace" "default" { | ||
name = "Default" | ||
} | ||
data "observe_user" "example" { | ||
email = "[email protected]" | ||
} | ||
data "observe_rbac_group" "example" { | ||
name = "engineering" | ||
} | ||
// "everyone" is a special pre-defined group that always includes all users | ||
data "observe_rbac_group" "everyone" { | ||
name = "everyone" | ||
} | ||
data "observe_dataset" "example" { | ||
workspace = data.observe_workspace.default.oid | ||
name = "Engineering Logs" | ||
} | ||
// Allow user example to create worksheets | ||
resource "observe_grant" "user_example" { | ||
subject = data.observe_user.example.oid | ||
role = "worksheet_creator" | ||
} | ||
// Allow group engineering to edit dataset Engineering Logs | ||
resource "observe_grant" "group_example" { | ||
subject = data.observe_rbac_group.example.oid | ||
role = "dataset_editor" | ||
qualifier { | ||
oid = data.observe_dataset.example.oid | ||
} | ||
} | ||
// Allow everyone to view dataset Engineering Logs | ||
resource "observe_grant" "everyone_example" { | ||
subject = data.observe_rbac_group.everyone.oid | ||
role = "dataset_viewer" | ||
qualifier { | ||
oid = data.observe_dataset.example.oid | ||
} | ||
} | ||
``` | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `role` (String) The role to grant. | ||
- `subject` (String) OID of the subject. Must be a user or a group. | ||
|
||
### Optional | ||
|
||
- `qualifier` (Block List, Max: 1) (see [below for nested schema](#nestedblock--qualifier)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `oid` (String) | ||
|
||
<a id="nestedblock--qualifier"></a> | ||
### Nested Schema for `qualifier` | ||
|
||
Optional: | ||
|
||
- `oid` (String) OID of the object this grant applies to. | ||
## Import | ||
Import is supported using the following syntax: | ||
```shell | ||
terraform import observe_grant.example 1414010 | ||
``` |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
data "observe_rbac_group" "example" { | ||
name = "example" | ||
} | ||
|
||
// In RBAC v2, "everyone" is a special pre-defined group that always includes all users. | ||
// Reach out to Observe to enable this feature. | ||
data "observe_rbac_group" "everyone" { | ||
name = "everyone" | ||
} |
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 @@ | ||
terraform import observe_grant.example 1414010 |
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,45 @@ | ||
data "observe_workspace" "default" { | ||
name = "Default" | ||
} | ||
|
||
data "observe_user" "example" { | ||
email = "[email protected]" | ||
} | ||
|
||
data "observe_rbac_group" "example" { | ||
name = "engineering" | ||
} | ||
|
||
// "everyone" is a special pre-defined group that always includes all users | ||
data "observe_rbac_group" "everyone" { | ||
name = "everyone" | ||
} | ||
|
||
data "observe_dataset" "example" { | ||
workspace = data.observe_workspace.default.oid | ||
name = "Engineering Logs" | ||
} | ||
|
||
// Allow user example to create worksheets | ||
resource "observe_grant" "user_example" { | ||
subject = data.observe_user.example.oid | ||
role = "worksheet_creator" | ||
} | ||
|
||
// Allow group engineering to edit dataset Engineering Logs | ||
resource "observe_grant" "group_example" { | ||
subject = data.observe_rbac_group.example.oid | ||
role = "dataset_editor" | ||
qualifier { | ||
oid = data.observe_dataset.example.oid | ||
} | ||
} | ||
|
||
// Allow everyone to view dataset Engineering Logs | ||
resource "observe_grant" "everyone_example" { | ||
subject = data.observe_rbac_group.everyone.oid | ||
role = "dataset_viewer" | ||
qualifier { | ||
oid = data.observe_dataset.example.oid | ||
} | ||
} |
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,15 @@ | ||
description: | | ||
NOTE: This feature is still under development. It is not meant for customer use yet. | ||
Manages an Observe grant. Grants allow configuring permissions for users and groups by | ||
assigning roles. A grant may also optionally be qualified by an object id. Replaces | ||
rbac_statement. Reach out to Observe to enable this feature. | ||
schema: | ||
subject: | | ||
OID of the subject. Must be a user or a group. | ||
role: | | ||
The role to grant. | ||
qualifier: | ||
oid: | | ||
OID of the object this grant applies to. |
Oops, something went wrong.