From 22b2c6855154badd72753294d79af7b6803a9393 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 15 Nov 2017 09:19:04 -0500 Subject: [PATCH] Adjust aws_dynamodb_table CreateTable LimitExceededException handling for different error messaging (#2274) * Adjust aws_dynamodb_table CreateTable LimitExceededException handling for different error messaging * #2274 review: r/aws_dynamodb_table: Update LimitExceededException retry message handling --- aws/resource_aws_dynamodb_table.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_dynamodb_table.go b/aws/resource_aws_dynamodb_table.go index b33b940a0dc..7cea1895aa1 100644 --- a/aws/resource_aws_dynamodb_table.go +++ b/aws/resource_aws_dynamodb_table.go @@ -331,8 +331,11 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er time.Sleep(DYNAMODB_THROTTLE_SLEEP) attemptCount += 1 case "LimitExceededException": - // If we're at resource capacity, error out without retry - if strings.Contains(awsErr.Message(), "Subscriber limit exceeded:") { + // If we're at resource capacity, error out without retry. e.g. + // Subscriber limit exceeded: There is a limit of 256 tables per subscriber + // Do not error out on this similar throttling message: + // Subscriber limit exceeded: Only 10 tables can be created, updated, or deleted simultaneously + if strings.Contains(awsErr.Message(), "Subscriber limit exceeded:") && !strings.Contains(awsErr.Message(), "can be created, updated, or deleted simultaneously") { return fmt.Errorf("AWS Error creating DynamoDB table: %s", err) } log.Printf("[DEBUG] Limit on concurrent table creations hit, sleeping for a bit")