| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | From ef15713b2e04a87966d2ddb8822d703c632c9551 Mon Sep 17 00:00:00 2001 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | From: Bert Blommers <info@bertblommers.nl> | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | Date: Sun, 13 Aug 2023 21:48:20 +0000 | 
					
						
							|  |  |  | Subject: [PATCH] Patch: RDS timings | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ---
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  |  internal/service/rds/cluster.go  | 16 ++++++++-------- | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  internal/service/rds/consts.go   |  2 +- | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  |  internal/service/rds/instance.go | 24 ++++++++++++------------ | 
					
						
							|  |  |  |  3 files changed, 21 insertions(+), 21 deletions(-) | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | index 5b71483600..e18e024e47 100644
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | --- a/internal/service/rds/cluster.go
 | 
					
						
							|  |  |  | +++ b/internal/service/rds/cluster.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -34,7 +34,7 @@ import (
 | 
					
						
							|  |  |  |  const ( | 
					
						
							|  |  |  |  	clusterScalingConfiguration_DefaultMinCapacity = 1 | 
					
						
							|  |  |  |  	clusterScalingConfiguration_DefaultMaxCapacity = 16 | 
					
						
							|  |  |  | -	clusterTimeoutDelete                           = 2 * time.Minute
 | 
					
						
							|  |  |  | +	clusterTimeoutDelete                           = 5 * time.Second
 | 
					
						
							|  |  |  |  ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  // @SDKResource("aws_rds_cluster", name="Cluster") | 
					
						
							|  |  |  | @@ -1365,7 +1365,7 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int
 | 
					
						
							|  |  |  |  			} | 
					
						
							|  |  |  |  		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -		_, err := tfresource.RetryWhen(ctx, 5*time.Minute,
 | 
					
						
							|  |  |  | +		_, err := tfresource.RetryWhen(ctx, 1*time.Minute,
 | 
					
						
							|  |  |  |  			func() (interface{}, error) { | 
					
						
							|  |  |  |  				return conn.ModifyDBClusterWithContext(ctx, input) | 
					
						
							|  |  |  |  			}, | 
					
						
							|  |  |  | @@ -1694,8 +1694,8 @@ func waitDBClusterCreated(ctx context.Context, conn *rds.RDS, id string, timeout
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  		Target:     []string{ClusterStatusAvailable}, | 
					
						
							|  |  |  |  		Refresh:    statusDBCluster(ctx, conn, id), | 
					
						
							|  |  |  |  		Timeout:    timeout, | 
					
						
							|  |  |  | -		MinTimeout: 10 * time.Second,
 | 
					
						
							|  |  |  | -		Delay:      30 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		MinTimeout: 1 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | +		Delay:      3 * time.Second,
 | 
					
						
							|  |  |  |  	} | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  	outputRaw, err := stateConf.WaitForStateContext(ctx) | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -1721,8 +1721,8 @@ func waitDBClusterUpdated(ctx context.Context, conn *rds.RDS, id string, timeout
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  		Target:     []string{ClusterStatusAvailable}, | 
					
						
							|  |  |  |  		Refresh:    statusDBCluster(ctx, conn, id), | 
					
						
							|  |  |  |  		Timeout:    timeout, | 
					
						
							|  |  |  | -		MinTimeout: 10 * time.Second,
 | 
					
						
							|  |  |  | -		Delay:      30 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		MinTimeout: 1 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | +		Delay:      3 * time.Second,
 | 
					
						
							|  |  |  |  	} | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  	outputRaw, err := stateConf.WaitForStateContext(ctx) | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -1745,8 +1745,8 @@ func waitDBClusterDeleted(ctx context.Context, conn *rds.RDS, id string, timeout
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  		Target:     []string{}, | 
					
						
							|  |  |  |  		Refresh:    statusDBCluster(ctx, conn, id), | 
					
						
							|  |  |  |  		Timeout:    timeout, | 
					
						
							|  |  |  | -		MinTimeout: 10 * time.Second,
 | 
					
						
							|  |  |  | -		Delay:      30 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		MinTimeout: 1 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | +		Delay:      3 * time.Second,
 | 
					
						
							|  |  |  |  	} | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  	outputRaw, err := stateConf.WaitForStateContext(ctx) | 
					
						
							|  |  |  | diff --git a/internal/service/rds/consts.go b/internal/service/rds/consts.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | index 6bc2ab6194..937ba77468 100644
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | --- a/internal/service/rds/consts.go
 | 
					
						
							|  |  |  | +++ b/internal/service/rds/consts.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -239,7 +239,7 @@ func backupTarget_Values() []string {
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  } | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  const ( | 
					
						
							|  |  |  | -	propagationTimeout = 2 * time.Minute
 | 
					
						
							|  |  |  | +	propagationTimeout = 2 * time.Second
 | 
					
						
							|  |  |  |  ) | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  const ( | 
					
						
							|  |  |  | diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | index eafddc13b0..86809379d9 100644
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | --- a/internal/service/rds/instance.go
 | 
					
						
							|  |  |  | +++ b/internal/service/rds/instance.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -77,9 +77,9 @@ func ResourceInstance() *schema.Resource {
 | 
					
						
							|  |  |  |  		}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  		Timeouts: &schema.ResourceTimeout{ | 
					
						
							|  |  |  | -			Create: schema.DefaultTimeout(40 * time.Minute),
 | 
					
						
							|  |  |  | -			Update: schema.DefaultTimeout(80 * time.Minute),
 | 
					
						
							|  |  |  | -			Delete: schema.DefaultTimeout(60 * time.Minute),
 | 
					
						
							|  |  |  | +			Create: schema.DefaultTimeout(40 * time.Second),
 | 
					
						
							|  |  |  | +			Update: schema.DefaultTimeout(80 * time.Second),
 | 
					
						
							|  |  |  | +			Delete: schema.DefaultTimeout(60 * time.Second),
 | 
					
						
							|  |  |  |  		}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  		Schema: map[string]*schema.Schema{ | 
					
						
							|  |  |  | @@ -1917,7 +1917,7 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, meta in
 | 
					
						
							|  |  |  |  				DBInstanceIdentifier: aws.String(sourceARN.Identifier), | 
					
						
							|  |  |  |  				SkipFinalSnapshot:    true, | 
					
						
							|  |  |  |  			} | 
					
						
							|  |  |  | -			_, err = tfresource.RetryWhen(ctx, 5*time.Minute,
 | 
					
						
							|  |  |  | +			_, err = tfresource.RetryWhen(ctx, 1*time.Minute,
 | 
					
						
							|  |  |  |  				func() (any, error) { | 
					
						
							|  |  |  |  					return conn.DeleteDBInstance(ctx, deleteInput) | 
					
						
							|  |  |  |  				}, | 
					
						
							|  |  |  | @@ -2520,8 +2520,8 @@ func statusDBInstanceSDKv2(ctx context.Context, conn *rds_sdkv2.Client, id strin
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  func waitDBInstanceAvailableSDKv1(ctx context.Context, conn *rds.RDS, id string, timeout time.Duration, optFns ...tfresource.OptionsFunc) (*rds.DBInstance, error) { | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  	options := tfresource.Options{ | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | -		PollInterval:              10 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | -		Delay:                     1 * time.Minute,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		PollInterval:              5 * time.Second,
 | 
					
						
							|  |  |  | +		Delay:                     3 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  		ContinuousTargetOccurence: 3, | 
					
						
							|  |  |  |  	} | 
					
						
							|  |  |  |  	for _, fn := range optFns { | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -2563,8 +2563,8 @@ func waitDBInstanceAvailableSDKv1(ctx context.Context, conn *rds.RDS, id string,
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  func waitDBInstanceAvailableSDKv2(ctx context.Context, conn *rds_sdkv2.Client, id string, timeout time.Duration, optFns ...tfresource.OptionsFunc) (*rds.DBInstance, error) { //nolint:unparam | 
					
						
							|  |  |  |  	options := tfresource.Options{ | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | -		PollInterval:              10 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | -		Delay:                     1 * time.Minute,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		PollInterval:              2 * time.Second,
 | 
					
						
							|  |  |  | +		Delay:                     5 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  		ContinuousTargetOccurence: 3, | 
					
						
							|  |  |  |  	} | 
					
						
							|  |  |  |  	for _, fn := range optFns { | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -2606,8 +2606,8 @@ func waitDBInstanceAvailableSDKv2(ctx context.Context, conn *rds_sdkv2.Client, i
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  func waitDBInstanceDeleted(ctx context.Context, conn *rds.RDS, id string, timeout time.Duration, optFns ...tfresource.OptionsFunc) (*rds.DBInstance, error) { //nolint:unparam | 
					
						
							|  |  |  |  	options := tfresource.Options{ | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | -		PollInterval:              10 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | -		Delay:                     1 * time.Minute,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		PollInterval:              2 * time.Second,
 | 
					
						
							|  |  |  | +		Delay:                     5 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  |  		ContinuousTargetOccurence: 3, | 
					
						
							|  |  |  |  	} | 
					
						
							|  |  |  |  	for _, fn := range optFns { | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -2694,8 +2694,8 @@ func statusBlueGreenDeployment(ctx context.Context, conn *rds_sdkv2.Client, id s
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  func waitBlueGreenDeploymentAvailable(ctx context.Context, conn *rds_sdkv2.Client, id string, timeout time.Duration, optFns ...tfresource.OptionsFunc) (*types.BlueGreenDeployment, error) { | 
					
						
							|  |  |  |  	options := tfresource.Options{ | 
					
						
							|  |  |  | -		PollInterval: 10 * time.Second,
 | 
					
						
							|  |  |  | -		Delay:        1 * time.Minute,
 | 
					
						
							|  |  |  | +		PollInterval: 2 * time.Second,
 | 
					
						
							|  |  |  | +		Delay:        5 * time.Second,
 | 
					
						
							|  |  |  |  	} | 
					
						
							|  |  |  |  	for _, fn := range optFns { | 
					
						
							|  |  |  |  		fn(&options) | 
					
						
							| 
									
										
										
										
											2023-04-08 10:33:09 +00:00
										 |  |  | -- 
 | 
					
						
							|  |  |  | 2.25.1 | 
					
						
							|  |  |  | 
 |