Skip to content

Commit 4cbd179

Browse files
committed
fix secret
1 parent 5bc5c2b commit 4cbd179

File tree

5 files changed

+1022
-1018
lines changed

5 files changed

+1022
-1018
lines changed

internal/services/secret/secret_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,18 +326,20 @@ func testAccCheckSecretDestroy(tt *acctest.TestTools) resource.TestCheckFunc {
326326
return err
327327
}
328328

329-
_, err = api.GetSecret(&secretSDK.GetSecretRequest{
329+
s, err := api.GetSecret(&secretSDK.GetSecretRequest{
330330
SecretID: id,
331331
Region: region,
332332
})
333333

334-
if err == nil {
335-
return fmt.Errorf("secret (%s) still exists", rs.Primary.ID)
336-
}
337-
338334
if !httperrors.Is404(err) {
339335
return err
340336
}
337+
338+
if s != nil {
339+
if s.DeletionRequestedAt == nil {
340+
return fmt.Errorf("secret (%s) still exists", rs.Primary.ID)
341+
}
342+
}
341343
}
342344

343345
return nil

0 commit comments

Comments
 (0)