Skip to content

Commit

Permalink
Merge pull request #2791 from Trii/2781-add-rds-cluster-pending-states
Browse files Browse the repository at this point in the history
Handle RDS Cluster state `resetting-master-credentials` #2781
  • Loading branch information
jen20 authored Dec 29, 2017
2 parents db4da47 + 81d3ade commit 4d0dfaa
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions aws/resource_aws_rds_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error
log.Println("[INFO] Waiting for RDS Cluster to be available")

stateConf := &resource.StateChangeConf{
Pending: []string{"creating", "backing-up", "modifying", "preparing-data-migration", "migrating"},
Pending: resourceAwsRdsClusterCreatePendingStates,
Target: []string{"available"},
Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta),
Timeout: d.Timeout(schema.TimeoutCreate),
Expand Down Expand Up @@ -497,7 +497,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error
"[INFO] Waiting for RDS Cluster to be available")

stateConf := &resource.StateChangeConf{
Pending: []string{"creating", "backing-up", "modifying"},
Pending: resourceAwsRdsClusterCreatePendingStates,
Target: []string{"available"},
Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta),
Timeout: d.Timeout(schema.TimeoutCreate),
Expand Down Expand Up @@ -765,7 +765,7 @@ func resourceAwsRDSClusterDelete(d *schema.ResourceData, meta interface{}) error
}

stateConf := &resource.StateChangeConf{
Pending: []string{"available", "deleting", "backing-up", "modifying"},
Pending: resourceAwsRdsClusterDeletePendingStates,
Target: []string{"destroyed"},
Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta),
Timeout: d.Timeout(schema.TimeoutDelete),
Expand Down Expand Up @@ -859,3 +859,19 @@ func removeIamRoleFromRdsCluster(clusterIdentifier string, roleArn string, conn

return nil
}

var resourceAwsRdsClusterCreatePendingStates = []string{
"creating",
"backing-up",
"modifying",
"preparing-data-migration",
"migrating",
"resetting-master-credentials",
}

var resourceAwsRdsClusterDeletePendingStates = []string{
"available",
"deleting",
"backing-up",
"modifying",
}

0 comments on commit 4d0dfaa

Please sign in to comment.