Skip to content

Commit 8c52036

Browse files
committed
fix(access_keys): fix removal of access keys
1 parent 51d35d3 commit 8c52036

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.3.0
2+
3+
Bug Fix:
4+
5+
- An attempt to fix [this issue](https://github.com/dmpe/terraform-provider-storagegrid/issues/9) as reported by @bajo. Thanks.
6+
7+
18
## 1.2.0
29

310
FEATURES:

Diff for: internal/provider/s3_keys_by_user_id_resource.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ func (r *s3AccessSecretKeyResource) Update(ctx context.Context, req resource.Upd
214214
}
215215

216216
func (r *s3AccessSecretKeyResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
217-
var state UserIDS3AccessSecretKeysModel
217+
var state S3AccessKeyResourceModel
218218
diags := req.State.Get(ctx, &state)
219219
resp.Diagnostics.Append(diags...)
220220
if resp.Diagnostics.HasError() {
221221
return
222222
}
223223

224224
// in order for us to delete it, we first need to retrieve user id and access key
225-
_, _, _, err := r.client.SendRequest("DELETE", api_users+"/"+state.UserUUID.ValueString()+api_s3_suffix+"/"+state.Data.AccessKey.ValueString(), nil, 204)
225+
_, _, _, err := r.client.SendRequest("DELETE", api_users+"/"+state.UserUUID.ValueString()+api_s3_suffix+"/"+state.AccessKey.ValueString(), nil, 204)
226226
if err != nil {
227227
resp.Diagnostics.AddError(
228228
"Error Deleting StorageGrid access keys",

0 commit comments

Comments
 (0)