Skip to content

Commit

Permalink
resource/aws_config_delivery_channel: Retry deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Jan 9, 2018
1 parent 35d3651 commit 2a86c76
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion aws/resource_aws_config_delivery_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,18 @@ func resourceAwsConfigDeliveryChannelDelete(d *schema.ResourceData, meta interfa
input := configservice.DeleteDeliveryChannelInput{
DeliveryChannelName: aws.String(d.Id()),
}
_, err := conn.DeleteDeliveryChannel(&input)

err := resource.Retry(30*time.Second, func() *resource.RetryError {
_, err := conn.DeleteDeliveryChannel(&input)
if err != nil {
if isAWSErr(err, "LastDeliveryChannelDeleteFailedException", "there is a running configuration recorder") {
return resource.RetryableError(err)
}

return resource.NonRetryableError(err)
}
return nil
})
if err != nil {
return fmt.Errorf("Unable to delete delivery channel: %s", err)
}
Expand Down

0 comments on commit 2a86c76

Please sign in to comment.