Skip to content

Commit

Permalink
Merge pull request #7064 from terraform-providers/b-aws_dynamodb_tabl…
Browse files Browse the repository at this point in the history
…e-govcloud

resource/aws_dynamodb_table: Fix table creation in GovCloud (US) and China due to missing BillingMode support
  • Loading branch information
bflad authored Jan 8, 2019
2 parents 0d6a086 + 5e5762c commit cd5f835
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion aws/resource_aws_dynamodb_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,19 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er
if isAWSErr(err, dynamodb.ErrCodeLimitExceededException, "indexed tables that can be created simultaneously") {
return resource.RetryableError(err)
}
// AWS GovCloud (US) and others may reply with the following until their API is updated:
// ValidationException: One or more parameter values were invalid: Unsupported input parameter BillingMode
if isAWSErr(err, "ValidationException", "Unsupported input parameter BillingMode") {
req.BillingMode = nil
return resource.RetryableError(err)
}

return resource.NonRetryableError(err)
}
return nil
})
if err != nil {
return err
return fmt.Errorf("error creating DynamoDB Table: %s", err)
}

d.SetId(*output.TableDescription.TableName)
Expand Down

0 comments on commit cd5f835

Please sign in to comment.