Merge pull request #11795 from hashicorp/b-respect-400-rds-deletion
provider/aws: Catch 400 error from rds_cluster
This commit is contained in:
commit
327b9e2549
|
@ -611,6 +611,13 @@ func resourceAwsRDSClusterDelete(d *schema.ResourceData, meta interface{}) error
|
||||||
|
|
||||||
log.Printf("[DEBUG] RDS Cluster delete options: %s", deleteOpts)
|
log.Printf("[DEBUG] RDS Cluster delete options: %s", deleteOpts)
|
||||||
_, err := conn.DeleteDBCluster(&deleteOpts)
|
_, err := conn.DeleteDBCluster(&deleteOpts)
|
||||||
|
if err != nil {
|
||||||
|
if awsErr, ok := err.(awserr.Error); ok {
|
||||||
|
if "InvalidDBClusterStateFault" == awsErr.Code() {
|
||||||
|
return fmt.Errorf("RDS Cluster cannot be deleted: %s", awsErr.Message())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stateConf := &resource.StateChangeConf{
|
stateConf := &resource.StateChangeConf{
|
||||||
Pending: []string{"available", "deleting", "backing-up", "modifying"},
|
Pending: []string{"available", "deleting", "backing-up", "modifying"},
|
||||||
|
|
Loading…
Reference in New Issue