Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle RDS Cluster state resetting-master-credentials #2781 #2791

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
}