Skip to content

Commit

Permalink
Merge pull request #8161 from terraform-providers/t-ec2conn-mutating-…
Browse files Browse the repository at this point in the history
…objects

service/ec2: Automatically retry EC2 CreateVpnConnection and CreateVpnGateway requests for concurrency errors
  • Loading branch information
bflad authored Apr 5, 2019
2 parents 0d148e5 + dbaf0bf commit a2d5d0d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,20 @@ func (c *Config) Client() (interface{}, error) {
}
})

client.ec2conn.Handlers.Retry.PushBack(func(r *request.Request) {
if r.Operation.Name == "CreateVpnConnection" {
if isAWSErr(r.Error, "VpnConnectionLimitExceeded", "maximum number of mutating objects has been reached") {
r.Retryable = aws.Bool(true)
}
}

if r.Operation.Name == "CreateVpnGateway" {
if isAWSErr(r.Error, "VpnGatewayLimitExceeded", "maximum number of mutating objects has been reached") {
r.Retryable = aws.Bool(true)
}
}
})

client.kinesisconn.Handlers.Retry.PushBack(func(r *request.Request) {
if r.Operation.Name == "CreateStream" {
if isAWSErr(r.Error, kinesis.ErrCodeLimitExceededException, "simultaneously be in CREATING or DELETING") {
Expand Down

0 comments on commit a2d5d0d

Please sign in to comment.