Skip to content

Commit

Permalink
Merge pull request #10969 from nijave/nv-retry-cloudformation-stackse…
Browse files Browse the repository at this point in the history
…t-operations

Retry Cloudformation StackSet Create when the service is busy
  • Loading branch information
ewbankkit authored Aug 27, 2021
2 parents 340be07 + 5327bab commit 8166877
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changelog/10969.txt
Original file line number Diff line number Diff line change
@@ -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
```
6 changes: 6 additions & 0 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 8166877

Please sign in to comment.