From 60b53fc440f97761fd384844875ac717766d95b3 Mon Sep 17 00:00:00 2001 From: Stacey Salamon <111294980+staceysalamon-aiven@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:17:49 +0100 Subject: [PATCH] docs: combine examples into one for permissions (#1890) --- docs/resources/organization_permission.md | 14 +++----------- .../aiven_organization_permission/resource.tf | 16 ++++------------ 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/docs/resources/organization_permission.md b/docs/resources/organization_permission.md index 62266b542..ea7dbedf0 100644 --- a/docs/resources/organization_permission.md +++ b/docs/resources/organization_permission.md @@ -13,13 +13,12 @@ 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" @@ -27,14 +26,7 @@ resource "aiven_organization_permission" "operator" { 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", diff --git a/examples/resources/aiven_organization_permission/resource.tf b/examples/resources/aiven_organization_permission/resource.tf index c58efa389..bd5c391ce 100644 --- a/examples/resources/aiven_organization_permission/resource.tf +++ b/examples/resources/aiven_organization_permission/resource.tf @@ -1,10 +1,9 @@ -# 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" @@ -12,14 +11,7 @@ resource "aiven_organization_permission" "operator" { 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", @@ -29,4 +21,4 @@ resource "aiven_organization_permission" "developers" { principal_id = data.aiven_organization_user_group.example_group.group_id principal_type = "user_group" } -} \ No newline at end of file +}