Skip to content

Commit e973a0b

Browse files
authored
internal/sweep: additional skippable errors (#43657)
1 parent c60cb77 commit e973a0b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/sweep/awsv2/skip.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ func SkipSweepError(err error) bool {
9494
if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "Access Denied to API Version") {
9595
return true
9696
}
97+
// Example (GovCloud): InvalidParameterException: The DATA_PROTECTION_POLICY policy type is not supported in this region
98+
if tfawserr.ErrMessageContains(err, "InvalidParameterException", "DATA_PROTECTION_POLICY policy type is not supported in this region") {
99+
return true
100+
}
97101
// Example (GovCloud): The AppStream 2.0 user pool feature is not supported in the us-gov-west-1 AWS Region
98102
if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "feature is not supported") {
99103
return true
@@ -102,6 +106,10 @@ func SkipSweepError(err error) bool {
102106
if tfawserr.ErrMessageContains(err, "InvalidParameterValueException", "This API operation is currently unavailable") {
103107
return true
104108
}
109+
// Example (GovCloud): InvalidSignatureException: Credential should be scoped to a valid region
110+
if tfawserr.ErrMessageContains(err, "InvalidSignatureException", "Credential should be scoped to a valid region") {
111+
return true
112+
}
105113
// For example from us-west-2 Route53 zone
106114
if tfawserr.ErrMessageContains(err, "KeySigningKeyInParentDSRecord", "Due to DNS lookup failure") {
107115
return true
@@ -114,6 +122,10 @@ func SkipSweepError(err error) bool {
114122
if tfawserr.ErrMessageContains(err, "ResourceNotFoundException", "The subscription does not exist") {
115123
return true
116124
}
125+
// Example (GovCloud): SignatureDoesNotMatch: Credential should be scoped to a valid region
126+
if tfawserr.ErrMessageContains(err, "SignatureDoesNotMatch", "Credential should be scoped to a valid region") {
127+
return true
128+
}
117129
// For example from us-gov-east-1 IoT domain configuration
118130
if tfawserr.ErrMessageContains(err, "UnauthorizedException", "API is not available in") {
119131
return true

0 commit comments

Comments
 (0)