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

feat: add coderd_group resource #31

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Jul 17, 2024

Plus some acceptance test clean up.

@ethanndickson ethanndickson force-pushed the ethan/group-resource branch from 31f7669 to 0d1743d Compare July 17, 2024 08:12
@ethanndickson ethanndickson marked this pull request as ready for review July 17, 2024 08:13
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

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

Looks good but you should also wait for Colin's review

internal/provider/util.go Outdated Show resolved Hide resolved
stringplanmodifier.RequiresReplace(),
},
},
"members": schema.SetAttribute{
Copy link
Member

Choose a reason for hiding this comment

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

For groups (and eventually orgs), we probably should add some settings:

  • some property like unmanaged_members = true to avoid management of users (aka. only update the org properties not members)
  • some property like no_remove_members = true to avoid removing missing members

Copy link
Member Author

@ethanndickson ethanndickson Jul 18, 2024

Choose a reason for hiding this comment

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

Terraform doesn't allow providers to modify configured values. For a user to set unmanaged_members to true, they would also need to set members to null or an empty list (we'll go with null). We can reasonably implement this, but I don't think we need the field for it, setting members to null can just make members not be managed.

For the same reason, implementing a no_remove_members would be messy, as it would require us to store some hidden state separate from the configurable members keeping track of all members that the resource has seen throughout it's lifetime. Is this worth it?

internal/provider/group_resource.go Show resolved Hide resolved
docs/resources/group.md Outdated Show resolved Hide resolved
integration/integration.go Show resolved Hide resolved
internal/provider/group_resource.go Show resolved Hide resolved
internal/provider/group_resource.go Outdated Show resolved Hide resolved
internal/provider/group_resource.go Show resolved Hide resolved
internal/provider/util.go Outdated Show resolved Hide resolved
@ethanndickson ethanndickson force-pushed the ethan/group-resource branch from 773aee7 to f555328 Compare July 18, 2024 13:50
@ethanndickson ethanndickson merged commit b3458c7 into main Jul 19, 2024
13 checks passed
@ethanndickson ethanndickson deleted the ethan/group-resource branch July 26, 2024 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants