diff --git a/docs/resources/role.md b/docs/resources/role.md index e84df7ac..829b93b8 100644 --- a/docs/resources/role.md +++ b/docs/resources/role.md @@ -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 diff --git a/examples/resources/spectrocloud_role/resource.tf b/examples/resources/spectrocloud_role/resource.tf index 7c6b8bd5..846bd92f 100644 --- a/examples/resources/spectrocloud_role/resource.tf +++ b/examples/resources/spectrocloud_role/resource.tf @@ -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]) } \ No newline at end of file diff --git a/spectrocloud/resource_role.go b/spectrocloud/resource_role.go index 21bd31e7..f15b0c65 100644 --- a/spectrocloud/resource_role.go +++ b/spectrocloud/resource_role.go @@ -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,