| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | From 094b3837cd19df89d266038a91592126723cf833 Mon Sep 17 00:00:00 2001 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | From: Bert Blommers <info@bertblommers.nl> | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | Date: Sun, 13 Aug 2023 21:40:43 +0000 | 
					
						
							|  |  |  | Subject: [PATCH] Patch: Route53 timings | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ---
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  |  internal/service/route53/record.go | 10 +++++----- | 
					
						
							|  |  |  |  internal/service/route53/wait.go   | 14 +++++++------- | 
					
						
							|  |  |  |  internal/service/route53/zone.go   | 20 ++++++++++---------- | 
					
						
							|  |  |  |  3 files changed, 22 insertions(+), 22 deletions(-) | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | diff --git a/internal/service/route53/record.go b/internal/service/route53/record.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | index 4f2eb6d5ef..c4ba38824f 100644
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | --- a/internal/service/route53/record.go
 | 
					
						
							|  |  |  | +++ b/internal/service/route53/record.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -25,8 +25,8 @@ import (
 | 
					
						
							|  |  |  |  ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  const ( | 
					
						
							|  |  |  | -	recordSetSyncMinDelay = 10
 | 
					
						
							|  |  |  | -	recordSetSyncMaxDelay = 30
 | 
					
						
							|  |  |  | +	recordSetSyncMinDelay = 1
 | 
					
						
							|  |  |  | +	recordSetSyncMaxDelay = 3
 | 
					
						
							|  |  |  |  ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  // @SDKResource("aws_route53_record") | 
					
						
							|  |  |  | @@ -749,7 +749,7 @@ func FindResourceRecordSetByFourPartKey(ctx context.Context, conn *route53.Route
 | 
					
						
							|  |  |  |  } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  func ChangeResourceRecordSets(ctx context.Context, conn *route53.Route53, input *route53.ChangeResourceRecordSetsInput) (*route53.ChangeInfo, error) { | 
					
						
							|  |  |  | -	outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 1*time.Minute, func() (interface{}, error) {
 | 
					
						
							|  |  |  | +	outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, 10*time.Second, func() (interface{}, error) {
 | 
					
						
							|  |  |  |  		return conn.ChangeResourceRecordSetsWithContext(ctx, input) | 
					
						
							|  |  |  |  	}, route53.ErrCodeNoSuchHostedZone) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @@ -766,8 +766,8 @@ func WaitForRecordSetToSync(ctx context.Context, conn *route53.Route53, requestI
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  |  		Target:       []string{route53.ChangeStatusInsync}, | 
					
						
							|  |  |  |  		Delay:        time.Duration(rand.Int63n(recordSetSyncMaxDelay-recordSetSyncMinDelay)+recordSetSyncMinDelay) * time.Second, | 
					
						
							|  |  |  |  		MinTimeout:   5 * time.Second, | 
					
						
							|  |  |  | -		PollInterval: 20 * time.Second,
 | 
					
						
							|  |  |  | -		Timeout:      30 * time.Minute,
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | +		PollInterval: 2 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | +		Timeout:      3 * time.Minute,
 | 
					
						
							|  |  |  |  		Refresh: func() (result interface{}, state string, err error) { | 
					
						
							|  |  |  |  			changeRequest := &route53.GetChangeInput{ | 
					
						
							|  |  |  |  				Id: aws.String(requestId), | 
					
						
							|  |  |  | diff --git a/internal/service/route53/wait.go b/internal/service/route53/wait.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | index d8f577b269..2fc26bf570 100644
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | --- a/internal/service/route53/wait.go
 | 
					
						
							|  |  |  | +++ b/internal/service/route53/wait.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -16,17 +16,17 @@ import (
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  |  ) | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  |  const ( | 
					
						
							|  |  |  | -	changeTimeout      = 30 * time.Minute
 | 
					
						
							|  |  |  | +	changeTimeout      = 3 * time.Minute
 | 
					
						
							|  |  |  |  	changeMinTimeout   = 5 * time.Second | 
					
						
							|  |  |  | -	changePollInterval = 15 * time.Second
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | -	changeMinDelay     = 10
 | 
					
						
							|  |  |  | -	changeMaxDelay     = 30
 | 
					
						
							|  |  |  | +	changePollInterval = 1 * time.Second
 | 
					
						
							|  |  |  | +	changeMinDelay     = 1
 | 
					
						
							|  |  |  | +	changeMaxDelay     = 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | -	hostedZoneDNSSECStatusTimeout = 5 * time.Minute
 | 
					
						
							|  |  |  | +	hostedZoneDNSSECStatusTimeout = 1 * time.Minute
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | -	keySigningKeyStatusTimeout = 5 * time.Minute
 | 
					
						
							|  |  |  | +	keySigningKeyStatusTimeout = 1 * time.Minute
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | -	trafficPolicyInstanceOperationTimeout = 4 * time.Minute
 | 
					
						
							|  |  |  | +	trafficPolicyInstanceOperationTimeout = 1 * time.Minute
 | 
					
						
							|  |  |  |  ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  func waitChangeInfoStatusInsync(ctx context.Context, conn *route53.Route53, changeID string) (*route53.ChangeInfo, error) { //nolint:unparam | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | diff --git a/internal/service/route53/zone.go b/internal/service/route53/zone.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | index dc080c4916..493d5a41aa 100644
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  | --- a/internal/service/route53/zone.go
 | 
					
						
							|  |  |  | +++ b/internal/service/route53/zone.go
 | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | @@ -32,10 +32,10 @@ import (
 | 
					
						
							|  |  |  |  ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  const ( | 
					
						
							|  |  |  | -	zoneChangeSyncMinDelay        = 10
 | 
					
						
							|  |  |  | -	zoneChangeSyncMaxDelay        = 30
 | 
					
						
							|  |  |  | -	zoneChangeSyncMinPollInterval = 15
 | 
					
						
							|  |  |  | -	zoneChangeSyncMaxPollInterval = 30
 | 
					
						
							|  |  |  | +	zoneChangeSyncMinDelay        = 1
 | 
					
						
							|  |  |  | +	zoneChangeSyncMaxDelay        = 3
 | 
					
						
							|  |  |  | +	zoneChangeSyncMinPollInterval = 2
 | 
					
						
							|  |  |  | +	zoneChangeSyncMaxPollInterval = 3
 | 
					
						
							|  |  |  |  ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  // @SDKResource("aws_route53_zone", name="Hosted Zone") | 
					
						
							|  |  |  | @@ -424,7 +424,7 @@ func dnsSECStatus(ctx context.Context, conn *route53.Route53, hostedZoneID strin
 | 
					
						
							|  |  |  |  	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  	var output *route53.GetDNSSECOutput | 
					
						
							|  |  |  | -	err := tfresource.Retry(ctx, 3*time.Minute, func() *retry.RetryError {
 | 
					
						
							|  |  |  | +	err := tfresource.Retry(ctx, 3*time.Second, func() *retry.RetryError {
 | 
					
						
							|  |  |  |  		var err error | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  		output, err = conn.GetDNSSECWithContext(ctx, input) | 
					
						
							|  |  |  | @@ -439,7 +439,7 @@ func dnsSECStatus(ctx context.Context, conn *route53.Route53, hostedZoneID strin
 | 
					
						
							|  |  |  |  		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  		return nil | 
					
						
							|  |  |  | -	}, tfresource.WithDelayRand(1*time.Minute), tfresource.WithPollInterval(30*time.Second))
 | 
					
						
							|  |  |  | +	}, tfresource.WithDelayRand(5*time.Second), tfresource.WithPollInterval(3*time.Second))
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  	if tfresource.TimedOut(err) { | 
					
						
							|  |  |  |  		output, err = conn.GetDNSSECWithContext(ctx, input) | 
					
						
							|  |  |  | @@ -480,7 +480,7 @@ func disableDNSSECForHostedZone(ctx context.Context, conn *route53.Route53, host
 | 
					
						
							|  |  |  |  	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  	var output *route53.DisableHostedZoneDNSSECOutput | 
					
						
							|  |  |  | -	err = tfresource.Retry(ctx, 5*time.Minute, func() *retry.RetryError {
 | 
					
						
							|  |  |  | +	err = tfresource.Retry(ctx, 5*time.Second, func() *retry.RetryError {
 | 
					
						
							|  |  |  |  		var err error | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  		output, err = conn.DisableHostedZoneDNSSECWithContext(ctx, input) | 
					
						
							|  |  |  | @@ -495,7 +495,7 @@ func disableDNSSECForHostedZone(ctx context.Context, conn *route53.Route53, host
 | 
					
						
							|  |  |  |  		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  		return nil | 
					
						
							|  |  |  | -	}, tfresource.WithDelayRand(1*time.Minute), tfresource.WithPollInterval(20*time.Second))
 | 
					
						
							|  |  |  | +	}, tfresource.WithDelayRand(1*time.Second), tfresource.WithPollInterval(20*time.Second))
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  	if tfresource.TimedOut(err) { | 
					
						
							|  |  |  |  		output, err = conn.DisableHostedZoneDNSSECWithContext(ctx, input) | 
					
						
							|  |  |  | @@ -687,9 +687,9 @@ func waitForChangeSynchronization(ctx context.Context, conn *route53.Route53, ch
 | 
					
						
							|  |  |  |  		Pending:      []string{route53.ChangeStatusPending}, | 
					
						
							|  |  |  |  		Target:       []string{route53.ChangeStatusInsync}, | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  |  		Delay:        time.Duration(rand.Int63n(zoneChangeSyncMaxDelay-zoneChangeSyncMinDelay)+zoneChangeSyncMinDelay) * time.Second, | 
					
						
							| 
									
										
										
										
											2023-08-21 20:33:16 +00:00
										 |  |  | -		MinTimeout:   5 * time.Second,
 | 
					
						
							|  |  |  | +		MinTimeout:   1 * time.Second,
 | 
					
						
							| 
									
										
										
										
											2022-06-28 14:39:50 +00:00
										 |  |  |  		PollInterval: time.Duration(rand.Int63n(zoneChangeSyncMaxPollInterval-zoneChangeSyncMinPollInterval)+zoneChangeSyncMinPollInterval) * time.Second, | 
					
						
							|  |  |  | -		Timeout:      15 * time.Minute,
 | 
					
						
							|  |  |  | +		Timeout:      1 * time.Minute,
 | 
					
						
							|  |  |  |  		Refresh: func() (result interface{}, state string, err error) { | 
					
						
							|  |  |  |  			input := &route53.GetChangeInput{ | 
					
						
							|  |  |  |  				Id: aws.String(changeID), | 
					
						
							|  |  |  | -- 
 | 
					
						
							|  |  |  | 2.25.1 | 
					
						
							|  |  |  | 
 |