Skip to content

Commit

Permalink
Do not wait for status to become available if it is already available…
Browse files Browse the repository at this point in the history
…. This waited 30 seconds even if the status was already available. Fixes #30402.
  • Loading branch information
stefansundin committed Jun 23, 2023
1 parent 48e6cb7 commit 4fd5252
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/service/elasticache/replication_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,11 @@ func resourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, m
// Tags cannot be read when the replication group is not Available
log.Printf("[DEBUG] Waiting for ElastiCache Replication Group (%s) to become available", d.Id())

_, err = WaitReplicationGroupAvailable(ctx, conn, d.Id(), d.Timeout(schema.TimeoutUpdate))
if err != nil {
return sdkdiag.AppendErrorf(diags, "waiting for ElastiCache Replication Group to be available (%s): %s", aws.StringValue(rgp.ARN), err)
if aws.StringValue(rgp.Status) != "available" {
_, err = WaitReplicationGroupAvailable(ctx, conn, d.Id(), d.Timeout(schema.TimeoutUpdate))
if err != nil {
return sdkdiag.AppendErrorf(diags, "waiting for ElastiCache Replication Group to be available (%s): %s", aws.StringValue(rgp.ARN), err)
}
}

log.Printf("[DEBUG] ElastiCache Replication Group (%s): Checking underlying cache clusters", d.Id())
Expand Down

0 comments on commit 4fd5252

Please sign in to comment.