Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc fix 4.5.b #552

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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