Skip to content

Commit

Permalink
Adjust aws_dynamodb_table CreateTable LimitExceededException handling…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
bflad authored and radeksimko committed Nov 15, 2017
1 parent 036a42e commit 22b2c68
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aws/resource_aws_dynamodb_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 22b2c68

Please sign in to comment.