From 1fa092a10ecd8c9c3d973fa84a73751a3f698814 Mon Sep 17 00:00:00 2001 From: Nick Venenga Date: Wed, 20 Nov 2019 14:57:00 -0500 Subject: [PATCH 1/2] Retry Cloudformation StackSet Create when the service is busy Stack Sets only let a single stack per account be modified at the same time. When an operation is in progress, an `OperationInProgressException` is thrown that's similar to rate limiting errors. This adds that exception type to the built-in Retryer in the AWS SDK so it gets auto-retried like rate limits do --- aws/config.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/config.go b/aws/config.go index 9efb1331514..ff09b292064 100644 --- a/aws/config.go +++ b/aws/config.go @@ -779,6 +779,12 @@ func (c *Config) Client() (interface{}, error) { } }) + client.cfconn.Handlers.Retry.PushBack(func(r *request.Request) { + if isAWSErr(r.Error, cloudformation.ErrCodeOperationInProgressException, "Another Operation on StackSet") { + r.Retryable = aws.Bool(true) + } + }) + // See https://github.com/aws/aws-sdk-go/pull/1276 client.dynamodbconn.Handlers.Retry.PushBack(func(r *request.Request) { if r.Operation.Name != "PutItem" && r.Operation.Name != "UpdateItem" && r.Operation.Name != "DeleteItem" { From 5327baba38e5e97f1b795216c1254cee1b2f4fe1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 27 Aug 2021 09:49:00 -0400 Subject: [PATCH 2/2] Add CHANGELOG entry. --- .changelog/10969.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/10969.txt diff --git a/.changelog/10969.txt b/.changelog/10969.txt new file mode 100644 index 00000000000..128ccf87e54 --- /dev/null +++ b/.changelog/10969.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_cloudformation_stack_set_instance: Retry when `OperationInProgress` errors are returned from the AWS API +``` + +```release-note:enhancement +resource/aws_cloudformation_stack_set: Retry when `OperationInProgress` errors are returned from the AWS API +``` \ No newline at end of file