Skip to content

Commit

Permalink
resource/rds_cluster: Retry modification on InvalidDBClusterStateFault (
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Jun 13, 2017
1 parent 9918e73 commit e8f1d70
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions aws/resource_aws_rds_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,19 @@ func resourceAwsRDSClusterUpdate(d *schema.ResourceData, meta interface{}) error
}

if requestUpdate {
_, err := conn.ModifyDBCluster(req)
err := resource.Retry(5*time.Minute, func() *resource.RetryError {
_, err := conn.ModifyDBCluster(req)
if err != nil {
awsErr, ok := err.(awserr.Error)
if ok && awsErr.Code() == rds.ErrCodeInvalidDBClusterStateFault {
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
}
return nil
})
if err != nil {
return fmt.Errorf("[WARN] Error modifying RDS Cluster (%s): %s", d.Id(), err)
return fmt.Errorf("Failed to modify RDS Cluster (%s): %s", d.Id(), err)
}
}

Expand Down

0 comments on commit e8f1d70

Please sign in to comment.