Skip to content

Commit

Permalink
docs: combine examples into one for permissions (#1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
staceysalamon-aiven authored Nov 6, 2024
1 parent 1126ce2 commit 60b53fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
14 changes: 3 additions & 11 deletions docs/resources/organization_permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,20 @@ Grants [roles and permissions](https://aiven.io/docs/platform/concepts/permissio
## Example Usage

```terraform
# Grant the operator role and
# the permission to read service logs to a user
resource "aiven_organization_permission" "operator" {
resource "aiven_organization_permission" "example_permissions" {
organization_id = data.aiven_organization.main.id
resource_id = data.aiven_project.example_project.id
resource_type = "project"
permissions {
# Grant the operator role and permission to read service logs to a user
permissions = [
"operator",
"service:logs:read"
]
principal_id = "u123a456b7890c"
principal_type = "user"
}
}
# Grant the write project integrations permission, read project
# networking permission, and developer role to a group
resource "aiven_organization_permission" "developers" {
organization_id = data.aiven_organization.main.id
resource_id = data.aiven_project.example_project.id
resource_type = "project"
# Grant write project integrations and read project networking permissions, and the developer role to a group
permissions {
permissions = [
"project:integrations:write",
Expand Down
16 changes: 4 additions & 12 deletions examples/resources/aiven_organization_permission/resource.tf
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
# Grant the operator role and
# the permission to read service logs to a user
resource "aiven_organization_permission" "operator" {
resource "aiven_organization_permission" "example_permissions" {
organization_id = data.aiven_organization.main.id
resource_id = data.aiven_project.example_project.id
resource_type = "project"
permissions {
# Grant the operator role and permission to read service logs to a user
permissions = [
"operator",
"service:logs:read"
]
principal_id = "u123a456b7890c"
principal_type = "user"
}
}

# Grant the write project integrations permission, read project
# networking permission, and developer role to a group
resource "aiven_organization_permission" "developers" {
organization_id = data.aiven_organization.main.id
resource_id = data.aiven_project.example_project.id
resource_type = "project"
# Grant write project integrations and read project networking permissions, and the developer role to a group
permissions {
permissions = [
"project:integrations:write",
Expand All @@ -29,4 +21,4 @@ resource "aiven_organization_permission" "developers" {
principal_id = data.aiven_organization_user_group.example_group.group_id
principal_type = "user_group"
}
}
}

0 comments on commit 60b53fc

Please sign in to comment.