Skip to content

Commit e454b21

Browse files
committed
Merge pull request hashicorp#5271 from stack72/f-aws-dynamodb-stream-arn
provider/aws: Enable DynamoDB Table to output `stream_arm` when streams are enabled
2 parents 9c0d06b + 0ce4aed commit e454b21

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎builtin/providers/aws/resource_aws_dynamodb_table.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ func resourceAwsDynamoDbTable() *schema.Resource {
175175
},
176176
ValidateFunc: validateStreamViewType,
177177
},
178+
"stream_arn": &schema.Schema{
179+
Type: schema.TypeString,
180+
Computed: true,
181+
},
178182
},
179183
}
180184
}
@@ -641,6 +645,7 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro
641645
if table.StreamSpecification != nil {
642646
d.Set("stream_view_type", table.StreamSpecification.StreamViewType)
643647
d.Set("stream_enabled", table.StreamSpecification.StreamEnabled)
648+
d.Set("stream_arn", table.LatestStreamArn)
644649
}
645650

646651
err = d.Set("global_secondary_index", gsiList)

‎website/source/docs/providers/aws/r/dynamodb_table.html.markdown‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ parameter.
8484
* `non_key_attributes` - (Optional) Only required with *INCLUDE* as a
8585
projection type; a list of attributes to project into the index. These
8686
do not need to be defined as attributes on the table.
87-
* `stream_enabled` - (Optional) Indicates whether Streams is to be enabled (true) or disabled (false).
87+
* `stream_enabled` - (Optional) Indicates whether Streams are to be enabled (true) or disabled (false).
8888
* `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.
8989

9090
For `global_secondary_index` objects only, you need to specify
@@ -114,4 +114,5 @@ The following attributes are exported:
114114

115115
* `arn` - The arn of the table
116116
* `id` - The name of the table
117+
* `stream_arm` - The ARN of the Table Stream. Only available when `stream_enabled = true`
117118

0 commit comments

Comments
 (0)