Skip to content

Add cloudstack_role_permission resource#300

Open
bddvlpr wants to merge 2 commits into
apache:mainfrom
bddvlpr:feat/role-permission
Open

Add cloudstack_role_permission resource#300
bddvlpr wants to merge 2 commits into
apache:mainfrom
bddvlpr:feat/role-permission

Conversation

@bddvlpr

@bddvlpr bddvlpr commented Jul 9, 2026

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_permission resource 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"),
),
},
Comment thread cloudstack/provider.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants