Skip to content

Commit

Permalink
Doc fix 4.5.b (#552)
Browse files Browse the repository at this point in the history
* doc fix

* fix example

* doc fix
  • Loading branch information
SivaanandM authored Nov 26, 2024
1 parent 95f4023 commit 372e00d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/resources/role.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ resource "spectrocloud_role" "custom_role" {
### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `type` (String) The role type. Allowed values are `project` or `tenant` or `project`
- `type` (String) The role type. Allowed values are `project` or `tenant` or `resource`

### Read-Only

Expand Down
8 changes: 4 additions & 4 deletions examples/resources/spectrocloud_role/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ resource "spectrocloud_role" "custom_role" {
}

// set permission with data source permission

variable "perms" {
type = list(string)
default = ["App Profile", "App Deployment"]
default = ["User", "Team", "Role"]
}

data "spectrocloud_permission" "app_permissions" {
for_each = toset(var.perms)
name = each.key
scope = "tenant"
}

resource "spectrocloud_role" "custom_role_permission" {
name = "Test Cluster Role"
type = "project"
name = "Test Cluster Role With Custom Permission"
type = "tenant"
permissions = flatten([for p in data.spectrocloud_permission.app_permissions : p.permissions])
}
2 changes: 1 addition & 1 deletion spectrocloud/resource_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func resourceRole() *schema.Resource {
Optional: true,
Default: "project",
ValidateFunc: validation.StringInSlice([]string{"project", "tenant", "resource"}, false),
Description: "The role type. Allowed values are `project` or `tenant` or `project`",
Description: "The role type. Allowed values are `project` or `tenant` or `resource`",
},
"permissions": {
Type: schema.TypeSet,
Expand Down

0 comments on commit 372e00d

Please sign in to comment.