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

resource/dynamodb_table: Expose stream_label attribute #20

Merged
merged 1 commit into from
Jun 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions aws/resource_aws_dynamodb_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ func resourceAwsDynamoDbTable() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"stream_label": {
Type: schema.TypeString,
Computed: true,
},
"tags": tagsSchema(),
},
}
Expand Down Expand Up @@ -788,6 +792,7 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro
d.Set("stream_view_type", table.StreamSpecification.StreamViewType)
d.Set("stream_enabled", table.StreamSpecification.StreamEnabled)
d.Set("stream_arn", table.LatestStreamArn)
d.Set("stream_label", table.LatestStreamLabel)
}

err = d.Set("global_secondary_index", gsiList)
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_dynamodb_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func TestAccAWSDynamoDbTable_streamSpecification(t *testing.T) {
"aws_dynamodb_table.basic-dynamodb-table", "stream_enabled", "true"),
resource.TestCheckResourceAttr(
"aws_dynamodb_table.basic-dynamodb-table", "stream_view_type", "KEYS_ONLY"),
resource.TestCheckResourceAttrSet("aws_dynamodb_table.basic-dynamodb-table", "stream_arn"),
resource.TestCheckResourceAttrSet("aws_dynamodb_table.basic-dynamodb-table", "stream_label"),
),
},
},
Expand Down
5 changes: 4 additions & 1 deletion website/docs/r/dynamodb_table.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ The following attributes are exported:
* `arn` - The arn of the table
* `id` - The name of the table
* `stream_arn` - The ARN of the Table Stream. Only available when `stream_enabled = true`

* `stream_label` - A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not
a unique identifier for the stream on its own. However, the combination of AWS customer ID,
table name and this field is guaranteed to be unique.
It can be used for creating CloudWatch Alarms. Only available when `stream_enabled = true`

## Import

Expand Down