-
Notifications
You must be signed in to change notification settings - Fork 48
Add cloudstack_role
resource
#181
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
base: main
Are you sure you want to change the base?
Conversation
- Implement data source for cloudstack_role with read functionality. - Create resource for managing cloudstack_role with CRUD operations. - Update documentation for cloudstack_role data source and resource.
…and improved documentation - Added filter support to the cloudstack_role data source for role retrieval. - Updated resource_cloudstack_role to require either role_id or type. - Enhanced documentation for both data source and resource with examples and argument descriptions.
1. Add required 'type' parameter to role resource configuration in both resource and data source tests 2. Modify testAccCheckCloudStackRoleDestroy function to handle potential panic when accessing l.Roles[0]
role
resource role
resource
There was a problem hiding this comment.
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 adds a new cloudstack_role
resource and data source to the CloudStack Terraform provider, enabling users to create, read, update, and delete CloudStack roles through Terraform configuration. The implementation supports both creating roles from a specific type (Admin, ResourceAdmin, DomainAdmin, User) and cloning from existing roles.
- Implements both resource and data source for CloudStack roles
- Adds comprehensive test coverage for role operations
- Updates documentation and website navigation for the new resource
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
cloudstack/resource_cloudstack_role.go | Core implementation of the role resource with CRUD operations |
cloudstack/data_source_cloudstack_role.go | Data source implementation for role queries with filtering |
cloudstack/provider.go | Registers the new resource and data source in the provider |
cloudstack/resource_cloudstack_role_test.go | Test suite for role resource functionality |
cloudstack/data_source_cloudstack_role_test.go | Test suite for role data source functionality |
website/docs/r/role.html.markdown | Resource documentation with usage examples |
website/docs/d/role.html.markdown | Data source documentation with usage examples |
website/cloudstack.erb | Website navigation updates to include new documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Adding
role
as a terraform managed resource option -> https://cloudstack.apache.org/api/apidocs-4.20/apis/createRole.htmlContributes to #82
Using this code for example: