diff --git a/docs/resources/team_environment_assignment.md b/docs/resources/team_environment_assignment.md index a92d0091..3a5c5e41 100644 --- a/docs/resources/team_environment_assignment.md +++ b/docs/resources/team_environment_assignment.md @@ -38,11 +38,17 @@ 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" +} ``` @@ -51,7 +57,7 @@ resource "env0_team_environment_assignment" "assignment" { ### Required - `environment_id` (String) id of the environment -- `role_id` (String) id of the assigned role +- `role_id` (String) id of the assigned custom role. The following built-in roles can be passed as well: `Viewer`, `Planner`, `Deployer`, `Admin` - `team_id` (String) id of the team ### Read-Only diff --git a/docs/resources/team_organization_assignment.md b/docs/resources/team_organization_assignment.md index 3cc105e5..0b75f698 100644 --- a/docs/resources/team_organization_assignment.md +++ b/docs/resources/team_organization_assignment.md @@ -25,10 +25,15 @@ 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" +} ``` @@ -36,7 +41,7 @@ resource "env0_team_organization_assignment" "assignment" { ### Required -- `role_id` (String) id of the assigned role +- `role_id` (String) id of the assigned custom role. The following built-in roles can be passed as well: `User`, `Admin` - `team_id` (String) id of the team ### Read-Only 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" +}