diff --git a/builtin/providers/aws/resource_aws_rds_cluster.go b/builtin/providers/aws/resource_aws_rds_cluster.go index b6a0400da..f8a17e6cb 100644 --- a/builtin/providers/aws/resource_aws_rds_cluster.go +++ b/builtin/providers/aws/resource_aws_rds_cluster.go @@ -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"},