From f02de51d581151ef4bde597f9d56580c700bf3b9 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Fri, 3 Apr 2015 13:59:32 -0500 Subject: [PATCH] provider/aws: Fix refresh issue in Route 53 hosted zone Change the error handling/detection to correctly determine no hosted zone exists. --- builtin/providers/aws/resource_aws_route53_zone.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_route53_zone.go b/builtin/providers/aws/resource_aws_route53_zone.go index b60c91a79..a16a711b7 100644 --- a/builtin/providers/aws/resource_aws_route53_zone.go +++ b/builtin/providers/aws/resource_aws_route53_zone.go @@ -83,7 +83,7 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error _, err := r53.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(d.Id())}) if err != nil { // Handle a deleted zone - if strings.Contains(err.Error(), "404") { + if r53err, ok := err.(aws.APIError); ok && r53err.Code == "NoSuchHostedZone" { d.SetId("") return nil }