provider/aws: Guard APIGateway resource & REST API against deletion
This commit is contained in:
parent
0c5a0f96c2
commit
a338eae72a
|
@ -75,6 +75,10 @@ func resourceAwsApiGatewayResourceRead(d *schema.ResourceData, meta interface{})
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" {
|
||||||
|
d.SetId("")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,10 @@ func resourceAwsApiGatewayRestApiRead(d *schema.ResourceData, meta interface{})
|
||||||
RestApiId: aws.String(d.Id()),
|
RestApiId: aws.String(d.Id()),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" {
|
||||||
|
d.SetId("")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue