Skip to content

Commit

Permalink
Merge pull request #11795 from hashicorp/b-respect-400-rds-deletion
Browse files Browse the repository at this point in the history
provider/aws: Catch 400 error from rds_cluster
  • Loading branch information
grubernaut authored Feb 8, 2017
2 parents f8fdd6e + 6dd9796 commit 327b9e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin/providers/aws/resource_aws_rds_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 327b9e2

Please sign in to comment.