Skip to content

Commit

Permalink
tests/resource/aws_secretsmanager_secret_version: Handle additional m…
Browse files Browse the repository at this point in the history
…arked for deletion InvalidRequestException error during CheckDestroy

Previous output from acceptance testing:

```
--- FAIL: TestAccAwsSecretsManagerSecretVersion_Base64Binary (7.05s)
    testing.go:599: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: InvalidRequestException: You can’t perform this operation on the secret because it was marked for deletion.

--- FAIL: TestAccAwsSecretsManagerSecretVersion_BasicString (6.82s)
    testing.go:599: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: InvalidRequestException: You can’t perform this operation on the secret because it was marked for deletion.

--- FAIL: TestAccAwsSecretsManagerSecretVersion_VersionStages (16.18s)
    testing.go:599: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: InvalidRequestException: You can’t perform this operation on the secret because it was marked for deletion.
```

Output from acceptance testing:

```
--- PASS: TestAccAwsSecretsManagerSecretVersion_BasicString (11.80s)
--- PASS: TestAccAwsSecretsManagerSecretVersion_Base64Binary (11.81s)
--- PASS: TestAccAwsSecretsManagerSecretVersion_VersionStages (25.33s)
```
  • Loading branch information
bflad committed Apr 5, 2019
1 parent cafa62d commit cfdf4a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aws/resource_aws_secretsmanager_secret_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func testAccCheckAwsSecretsManagerSecretVersionDestroy(s *terraform.State) error
if isAWSErr(err, secretsmanager.ErrCodeResourceNotFoundException, "") {
return nil
}
if isAWSErr(err, secretsmanager.ErrCodeInvalidRequestException, "You can’t perform this operation on the secret because it was deleted") {
if isAWSErr(err, secretsmanager.ErrCodeInvalidRequestException, "was deleted") || isAWSErr(err, secretsmanager.ErrCodeInvalidRequestException, "was marked for deletion") {
return nil
}
return err
Expand Down

0 comments on commit cfdf4a0

Please sign in to comment.