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:
parent
0cff04a37f
commit
f02de51d58
|
@ -83,7 +83,7 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error
|
||||||
_, err := r53.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(d.Id())})
|
_, err := r53.GetHostedZone(&route53.GetHostedZoneRequest{ID: aws.String(d.Id())})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Handle a deleted zone
|
// Handle a deleted zone
|
||||||
if strings.Contains(err.Error(), "404") {
|
if r53err, ok := err.(aws.APIError); ok && r53err.Code == "NoSuchHostedZone" {
|
||||||
d.SetId("")
|
d.SetId("")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue