provider/aws: Expect exception on deletion of APIG Usage Plan Key (#14958)

This commit is contained in:
Radek Simko 2017-06-01 06:23:02 +01:00 committed by GitHub
parent 12aa4bd56e
commit bc314ca8a0
1 changed files with 3 additions and 1 deletions

View File

@ -102,10 +102,12 @@ func resourceAwsApiGatewayUsagePlanKeyDelete(d *schema.ResourceData, meta interf
UsagePlanId: aws.String(d.Get("usage_plan_id").(string)), UsagePlanId: aws.String(d.Get("usage_plan_id").(string)),
KeyId: aws.String(d.Get("key_id").(string)), KeyId: aws.String(d.Get("key_id").(string)),
}) })
if err == nil { if err == nil {
return nil return nil
} }
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" {
return nil
}
return resource.NonRetryableError(err) return resource.NonRetryableError(err)
}) })