Add cloudstack_role_permission resource#300
Open
bddvlpr wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Terraform resource for managing individual CloudStack role permission rules (allow/deny) so role ACLs can be managed at per-API (or wildcard) granularity from Terraform.
Changes:
- Adds
cloudstack_role_permissionresource with CRUD support, including in-place updates for allow/deny toggling. - Adds an acceptance test covering basic create + update of the permission attribute.
- Adds end-user documentation and wires the new resource into the website sidebar and provider resource map.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
website/docs/r/role_permission.html.markdown |
Adds documentation for the new cloudstack_role_permission resource, including usage and arguments. |
website/cloudstack.erb |
Adds the resource to the docs sidebar navigation. |
cloudstack/resource_cloudstack_role_permission.go |
Implements the new role-permission Terraform resource (Create/Read/Update/Delete). |
cloudstack/resource_cloudstack_role_permission_test.go |
Adds an acceptance test for create + update behavior. |
cloudstack/provider.go |
Registers the new resource in the provider’s resource map. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+51
to
+58
| { | ||
| Config: testAccCloudStackRolePermission_update, | ||
| Check: resource.ComposeTestCheckFunc( | ||
| testAccCheckCloudStackRolePermissionExists("cloudstack_role_permission.foo", &rolePermission), | ||
| resource.TestCheckResourceAttr( | ||
| "cloudstack_role_permission.foo", "permission", "deny"), | ||
| ), | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates the cloudstack_role_permission resource for managing individual allow/deny rules on a role where previously this was not possible through Terraform. Rules target an API name or wildcard and support in-place toggling between allow and deny without replacement.
Tested on the basic CRUD operations on the simulator and an actual environment.