provider/aws: Update Route53 Zone tests

This commit is contained in:
clint shryock 2015-12-22 14:58:43 -06:00
parent 05983fde21
commit 363defb548
1 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/route53" "github.com/aws/aws-sdk-go/service/route53"
) )
@ -277,6 +278,12 @@ func testAccCheckRoute53RecordDestroy(s *terraform.State) error {
resp, err := conn.ListResourceRecordSets(lopts) resp, err := conn.ListResourceRecordSets(lopts)
if err != nil { if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// if NoSuchHostedZone, then all the things are destroyed
if awsErr.Code() == "NoSuchHostedZone" {
return nil
}
}
return err return err
} }
if len(resp.ResourceRecordSets) == 0 { if len(resp.ResourceRecordSets) == 0 {