Skip to content

Commit

Permalink
Working group resource
Browse files Browse the repository at this point in the history
  • Loading branch information
papegaaij committed Sep 14, 2023
1 parent 1801046 commit 59f90af
Show file tree
Hide file tree
Showing 3 changed files with 2,610 additions and 4,001 deletions.
6 changes: 4 additions & 2 deletions examples/provider-install-verification/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ data "keyhub_group" "test" {
resource "keyhub_group" "terra" {
name = "Terraform"
additional_objects = {
admins = {
accounts = {
items = [{

uuid = "7ea6622b-f9d2-4e52-a799-217b26f88376"
rights = "MANAGER"
}]
}
requeststatus = "MEMBER"
}
}

Expand Down
2 changes: 2 additions & 0 deletions internal/provider/group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (r *groupResource) Create(ctx context.Context, req resource.CreateRequest,
return
}

ctx = context.WithValue(ctx, "keyhub_client", r.client)
obj, diags := types.ObjectValueFrom(ctx, groupGroupAttrTypesRSRecurse, data)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
Expand Down Expand Up @@ -113,6 +114,7 @@ func (r *groupResource) Read(ctx context.Context, req resource.ReadRequest, resp
}

ctx = tflog.SetField(ctx, "keyhub_group_uuid", data.UUID.ValueString())
ctx = context.WithValue(ctx, "keyhub_client", r.client)
tflog.Debug(ctx, "Reading group from Topicus KeyHub by UUID")
groups, err := r.client.Group().Get(ctx, &keyhubgroup.GroupRequestBuilderGetRequestConfiguration{
QueryParameters: &keyhubgroup.GroupRequestBuilderGetQueryParameters{
Expand Down
Loading

0 comments on commit 59f90af

Please sign in to comment.