Skip to content

Commit

Permalink
Merge pull request #36092 from hashicorp/s-fixes
Browse files Browse the repository at this point in the history
shield+memorydb: Fix sweepers
  • Loading branch information
ewbankkit authored Mar 5, 2024
2 parents fa99a66 + c81f372 commit 8f30f0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/sweep/awsv1/skip.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func SkipSweepError(err error) bool {
if tfawserr.ErrMessageContains(err, "UnauthorizedException", "API is not available in") {
return true
}
// For example from us-gov-west-1 MemoryDB cluster
if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "Access Denied to API Version") {
return true
}

return false
}
8 changes: 8 additions & 0 deletions internal/sweep/awsv2/skip.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ func SkipSweepError(err error) bool {
if tfawserr.ErrMessageContains(err, "ValidationException", "Account not found for the request") {
return true
}
// Example (shield): ResourceNotFoundException: The subscription does not exist
if tfawserr.ErrMessageContains(err, "ResourceNotFoundException", "The subscription does not exist") {
return true
}
// Example (GovCloud): InvalidParameterValueException: Access Denied to API Version: CORNERSTONE_V1
if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "Access Denied to API Version") {
return true
}

return false
}

0 comments on commit 8f30f0e

Please sign in to comment.