techBeck03 / terraform-provider-guacamole

Terraform provider for apache gaucamole
Apache License 2.0
15 stars 10 forks source link

Added member_users and member_groups to resource_user_group #14

Open bamhm182 opened 11 months ago

bamhm182 commented 11 months ago

This PR aims to resolve issue #13 , which I created to discuss the possibility of adding a connection to a pre-existing user. The way that this resolves this PR is through adding properties for member_users and member_groups to resources/user_group.go. Within the official Apache Guacamole web client, an administrator may create a User Group, and may assign multiple users and connections to the connection group. Upon creation, the users of the group may see the connections within the group. The changes made within this PR call the same API endpoints which are called by the official Guacamole web client.

bamhm182 commented 11 months ago

I also updated the GitHub Actions to HashiCorp's currently recommended release action here and deleted the vendor folder. I'm brand new to go and creating terraform providers, but things did not seem to be working as expected with that vendor folder being there, then they started working when I deleted the vendor folder. From a little research, it seems as though that directory is similar to node's node_modules directory, and typically wouldn't be pushed to a repo.

I also went about figuring out how to release a provider on the terraform registry and can confirm that the changes work as expected. My only issue is that guacamole-api-client could benefit from a validateUsers function similar to the validateGroups function that exists, so that we could prevent trying to add a user if the user doesn't exist. If you do that currently, nothing fails. The group is created, it just doesn't have the (non-existant) user added to it, which can be a little confusing until you realize what's going on.