provider/aws: Fix refresh issue in Route 53 hosted zone

Change the error handling/detection to correctly determine no hosted zone
exists.
This commit is contained in:
Clint Shryock 2015-04-03 13:59:32 -05:00
parent 0cff04a37f
commit f02de51d58
1 changed files with 1 additions and 1 deletions

View File

@ -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
}