Skip to content

Commit

Permalink
Feat: document team assignments with built-in roles (#821)
Browse files Browse the repository at this point in the history
* Feat: document team assignments with built-in roles

* Fix example

* markup
  • Loading branch information
TomerHeber committed Apr 7, 2024
1 parent dc3d675 commit b604743
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion env0/resource_team_environment_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion env0/resource_team_organization_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit b604743

Please sign in to comment.