From 6752c0095a6056cffa15589293ffe2e04e56faad Mon Sep 17 00:00:00 2001 From: Farid Nouri Neshat Date: Wed, 15 Apr 2026 09:37:25 +0200 Subject: [PATCH] redshift: treat Maintenance as pending during cluster create Acceptance test TestAccRedshiftClusterSnapshot_Tags_ComputedTag_OnUpdate_add failed in Step 1/3 while creating the backing aws_redshift_cluster.test from internal/service/redshift/testdata/ClusterSnapshot/tags/main_gen.tf. Original error: Error: creating Redshift Cluster (tf-acc-test-8275424384619408802): waiting for completion: unexpected state 'Maintenance', wanted target 'Available'. last error: creating Amazon Redshift documents ClusterAvailabilityStatus values as Available, Unavailable, Maintenance, Modifying, and Failed in the Cluster API reference. AWS re:Post also describes Maintenance as a normal state while Redshift applies updates or performs system tasks. waitClusterCreated should therefore treat Maintenance as pending, matching the existing Redshift update and delete waiters. References: - https://docs.aws.amazon.com/redshift/latest/APIReference/API_Cluster.html - https://repost.aws/knowledge-center/redshift-cluster-status --- .changelog/47460.txt | 3 +++ internal/service/redshift/wait.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/47460.txt diff --git a/.changelog/47460.txt b/.changelog/47460.txt new file mode 100644 index 000000000000..4e24c083f1dd --- /dev/null +++ b/.changelog/47460.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_redshift_cluster: Prevent failures during creation when the cluster enters `Maintenance`. +``` diff --git a/internal/service/redshift/wait.go b/internal/service/redshift/wait.go index d186ec2a1b6d..fc110e5b269e 100644 --- a/internal/service/redshift/wait.go +++ b/internal/service/redshift/wait.go @@ -18,7 +18,7 @@ import ( func waitClusterCreated(ctx context.Context, conn *redshift.Client, id string, timeout time.Duration) (*awstypes.Cluster, error) { stateConf := &retry.StateChangeConf{ - Pending: []string{clusterAvailabilityStatusModifying, clusterAvailabilityStatusUnavailable}, + Pending: []string{clusterAvailabilityStatusMaintenance, clusterAvailabilityStatusModifying, clusterAvailabilityStatusUnavailable}, Target: []string{clusterAvailabilityStatusAvailable}, Refresh: statusClusterAvailability(conn, id), Timeout: timeout,