From d2fa106f978a9c3a033f4672859a18deb88538fd Mon Sep 17 00:00:00 2001 From: Sebastian Maj Date: Wed, 16 Aug 2017 10:16:30 +0100 Subject: [PATCH] Workaround for https://github.com/aws/aws-sdk-go/issues/1472 --- aws/config.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/config.go b/aws/config.go index a6e4af6b466..757b1704e86 100644 --- a/aws/config.go +++ b/aws/config.go @@ -399,6 +399,20 @@ func (c *Config) Client() (interface{}, error) { } }) + // Workaround for https://github.com/aws/aws-sdk-go/issues/1472 + client.appautoscalingconn.Handlers.Retry.PushBack(func(r *request.Request) { + if !strings.HasPrefix(r.Operation.Name, "Describe") && !strings.HasPrefix(r.Operation.Name, "List") { + return + } + err, ok := r.Error.(awserr.Error) + if !ok || err == nil { + return + } + if err.Code() == applicationautoscaling.ErrCodeFailedResourceAccessException { + r.Retryable = aws.Bool(true) + } + }) + return &client, nil }