From 3b59498827eec3f70db204faef1306b3e79c50cd Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 30 Jan 2018 13:17:37 +0000 Subject: [PATCH] resource/aws_dynamodb_table: Add custom creation timeout --- aws/resource_aws_dynamodb_table.go | 3 ++- website/docs/r/dynamodb_table.html.markdown | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_dynamodb_table.go b/aws/resource_aws_dynamodb_table.go index a138929a9ce..23605e1af4b 100644 --- a/aws/resource_aws_dynamodb_table.go +++ b/aws/resource_aws_dynamodb_table.go @@ -25,6 +25,7 @@ func resourceAwsDynamoDbTable() *schema.Resource { }, Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), Delete: schema.DefaultTimeout(10 * time.Minute), Update: schema.DefaultTimeout(10 * time.Minute), }, @@ -271,7 +272,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er d.SetId(*output.TableDescription.TableName) d.Set("arn", output.TableDescription.TableArn) - if err := waitForDynamoDbTableToBeActive(d.Id(), 10*time.Minute, conn); err != nil { + if err := waitForDynamoDbTableToBeActive(d.Id(), d.Timeout(schema.TimeoutCreate), conn); err != nil { return err } diff --git a/website/docs/r/dynamodb_table.html.markdown b/website/docs/r/dynamodb_table.html.markdown index 78fc197c1e6..b91c6f10c99 100644 --- a/website/docs/r/dynamodb_table.html.markdown +++ b/website/docs/r/dynamodb_table.html.markdown @@ -90,6 +90,14 @@ attributes, etc. * `stream_view_type` - (Optional) When an item in the table is modified, StreamViewType determines what information is written to the table's stream. Valid values are `KEYS_ONLY`, `NEW_IMAGE`, `OLD_IMAGE`, `NEW_AND_OLD_IMAGES`. * `tags` - (Optional) A map of tags to populate on the created table. +### Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 10 mins) Used when creating the table +* `update` - (Defaults to 10 mins) Used when updating the table +* `delete` - (Defaults to 10 mins) Used when deleting the table + ### Nested fields #### `local_secondary_index`