Skip to content

Commit

Permalink
Merge pull request #9780 from terraform-providers/rfd-retry-iot
Browse files Browse the repository at this point in the history
Final retry deleting iot types
  • Loading branch information
ryndaniels authored Aug 20, 2019
2 parents 9ec6caa + d01b7c8 commit 119ee3a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion aws/resource_aws_iot_thing_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func resourceAwsIotThingTypeDelete(d *schema.ResourceData, meta interface{}) err
}
log.Printf("[DEBUG] Deleting IoT Thing Type: %s", deleteParams)

return resource.Retry(6*time.Minute, func() *resource.RetryError {
err = resource.Retry(6*time.Minute, func() *resource.RetryError {
_, err := conn.DeleteThingType(deleteParams)

if err != nil {
Expand All @@ -204,4 +204,14 @@ func resourceAwsIotThingTypeDelete(d *schema.ResourceData, meta interface{}) err

return nil
})
if isResourceTimeoutError(err) {
_, err = conn.DeleteThingType(deleteParams)
if isAWSErr(err, iot.ErrCodeResourceNotFoundException, "") {
return nil
}
}
if err != nil {
return fmt.Errorf("Error deleting IOT thing type: %s", err)
}
return nil
}

0 comments on commit 119ee3a

Please sign in to comment.