Skip to content

Commit

Permalink
tests/r/route53_zone: Skip private zones from DNSSEC error
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Jun 21, 2021
1 parent 459ab86 commit 439d03e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions aws/aws_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ func testSweepSkipSweepError(err error) bool {
if isAWSErr(err, "InvalidAction", "Unavailable Operation") {
return true
}
// For example from us-west-2 Route53 key signing key
if isAWSErr(err, "InvalidKeySigningKeyStatus", "cannot be deleted because") {
return true
}
// For example from us-west-2 Route53 zone
if isAWSErr(err, "KeySigningKeyInParentDSRecord", "Due to DNS lookup failure") {
return true
}
return false
}

Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_route53_key_signing_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func testSweepRoute53KeySigningKeys(region string) error {
errs = multierror.Append(errs, fmt.Errorf("error sweeping Route53 Key-Signing Keys for %s: %w", region, err))
}

if strings.Contains(errs.ErrorOrNil().Error(), "cannot be deleted because") {
if errs.ErrorOrNil() != nil && strings.Contains(errs.ErrorOrNil().Error(), "cannot be deleted because") {
log.Printf("[WARN] Skipping Route53 Key-Signing Keys sweep for %s: %s", region, errs)
return nil
}
Expand Down
4 changes: 4 additions & 0 deletions aws/resource_aws_route53_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ func dnsSECStatus(conn *route53.Route53, hostedZoneID string) (string, error) {
output, err = conn.GetDNSSEC(input)
}

if tfawserr.ErrMessageContains(err, route53.ErrCodeInvalidArgument, "Operation is unsupported for private") {
return "NOT_SIGNING", nil
}

if err != nil {
return "", err
}
Expand Down

0 comments on commit 439d03e

Please sign in to comment.