Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust aws_dynamodb_table CreateTable LimitExceededException handling for different error messaging #2274

Merged
merged 2 commits into from
Nov 15, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(), "simultaneously") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind tightening this a little bit, just to make sure we don't match an error we don't want to match? e.g. can be created, updated, or deleted simultaneously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem at all - will update shortly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a problem at all - will update shortly

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