Merge pull request #11795 from hashicorp/b-respect-400-rds-deletion

provider/aws: Catch 400 error from rds_cluster
This commit is contained in:
Jake Champlin 2017-02-08 14:26:24 -05:00 committed by GitHub
commit 327b9e2549
1 changed files with 7 additions and 0 deletions

View File

@ -611,6 +611,13 @@ func resourceAwsRDSClusterDelete(d *schema.ResourceData, meta interface{}) error
log.Printf("[DEBUG] RDS Cluster delete options: %s", 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{
Pending: []string{"available", "deleting", "backing-up", "modifying"},