From 0ce4aed52ad9be15d7f7ef9f70209ffc39a2d398 Mon Sep 17 00:00:00 2001 From: stack72 Date: Tue, 23 Feb 2016 15:40:41 +0000 Subject: [PATCH] provider/aws: Enable DynamoDB Table to output `stream_arm` when streams are enabled --- builtin/providers/aws/resource_aws_dynamodb_table.go | 5 +++++ .../source/docs/providers/aws/r/dynamodb_table.html.markdown | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_dynamodb_table.go b/builtin/providers/aws/resource_aws_dynamodb_table.go index 9442d09a6..d52194333 100644 --- a/builtin/providers/aws/resource_aws_dynamodb_table.go +++ b/builtin/providers/aws/resource_aws_dynamodb_table.go @@ -175,6 +175,10 @@ func resourceAwsDynamoDbTable() *schema.Resource { }, ValidateFunc: validateStreamViewType, }, + "stream_arn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -641,6 +645,7 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro if table.StreamSpecification != nil { d.Set("stream_view_type", table.StreamSpecification.StreamViewType) d.Set("stream_enabled", table.StreamSpecification.StreamEnabled) + d.Set("stream_arn", table.LatestStreamArn) } err = d.Set("global_secondary_index", gsiList) diff --git a/website/source/docs/providers/aws/r/dynamodb_table.html.markdown b/website/source/docs/providers/aws/r/dynamodb_table.html.markdown index cf84fcc03..5e9c2ec4d 100644 --- a/website/source/docs/providers/aws/r/dynamodb_table.html.markdown +++ b/website/source/docs/providers/aws/r/dynamodb_table.html.markdown @@ -84,7 +84,7 @@ parameter. * `non_key_attributes` - (Optional) Only required with *INCLUDE* as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table. -* `stream_enabled` - (Optional) Indicates whether Streams is to be enabled (true) or disabled (false). +* `stream_enabled` - (Optional) Indicates whether Streams are to be enabled (true) or disabled (false). * `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. For `global_secondary_index` objects only, you need to specify @@ -114,4 +114,5 @@ The following attributes are exported: * `arn` - The arn of the table * `id` - The name of the table +* `stream_arm` - The ARN of the Table Stream. Only available when `stream_enabled = true`