From b604743720ca5b44b372418511bef9f196ac41a7 Mon Sep 17 00:00:00 2001 From: Tomer Heber Date: Sun, 7 Apr 2024 08:45:26 -0500 Subject: [PATCH] Feat: document team assignments with built-in roles (#821) * Feat: document team assignments with built-in roles * Fix example * markup --- env0/resource_team_environment_assignment.go | 2 +- env0/resource_team_organization_assignment.go | 2 +- .../env0_team_environment_assignment/resource.tf | 8 +++++++- .../env0_team_organization_assignment/resource.tf | 7 ++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/env0/resource_team_environment_assignment.go b/env0/resource_team_environment_assignment.go index 88443396..b417786d 100644 --- a/env0/resource_team_environment_assignment.go +++ b/env0/resource_team_environment_assignment.go @@ -31,7 +31,7 @@ func resourceTeamEnvironmentAssignment() *schema.Resource { }, "role_id": { Type: schema.TypeString, - Description: "id of the assigned role", + Description: "id of the assigned custom role. The following built-in roles can be passed as well: `Viewer`, `Planner`, `Deployer`, `Admin`", Required: true, ValidateDiagFunc: ValidateNotEmptyString, }, diff --git a/env0/resource_team_organization_assignment.go b/env0/resource_team_organization_assignment.go index 513523c2..27ff2606 100644 --- a/env0/resource_team_organization_assignment.go +++ b/env0/resource_team_organization_assignment.go @@ -27,7 +27,7 @@ func resourceTeamOrganizationAssignment() *schema.Resource { }, "role_id": { Type: schema.TypeString, - Description: "id of the assigned role", + Description: "id of the assigned custom role. The following built-in roles can be passed as well: `User`, `Admin`", Required: true, ValidateDiagFunc: ValidateNotEmptyString, }, diff --git a/examples/resources/env0_team_environment_assignment/resource.tf b/examples/resources/env0_team_environment_assignment/resource.tf index a24e9829..3fdc361e 100644 --- a/examples/resources/env0_team_environment_assignment/resource.tf +++ b/examples/resources/env0_team_environment_assignment/resource.tf @@ -23,8 +23,14 @@ resource "env0_custom_role" "custom_role" { ] } -resource "env0_team_environment_assignment" "assignment" { +resource "env0_team_environment_assignment" "custom_role_assignment" { team_id = env0_team.team.id environment_id = env0_environment.environment.id role_id = env0_custom_role.custom_role.id } + +resource "env0_team_environment_assignment" "builtin_role_assignment" { + team_id = env0_team.team.id + environment_id = env0_environment.environment.id + role_id = "Viewer" +} diff --git a/examples/resources/env0_team_organization_assignment/resource.tf b/examples/resources/env0_team_organization_assignment/resource.tf index ea225cd4..22e51282 100644 --- a/examples/resources/env0_team_organization_assignment/resource.tf +++ b/examples/resources/env0_team_organization_assignment/resource.tf @@ -10,7 +10,12 @@ resource "env0_custom_role" "custom_role" { ] } -resource "env0_team_organization_assignment" "assignment" { +resource "env0_team_organization_assignment" "custom_role_assignment" { team_id = env0_team.team.id role_id = env0_custom_role.custom_role.id } + +resource "env0_team_organization_assignment" "builtin_role_assignment" { + team_id = env0_team.team.id + role_id = "Admin" +}