Enable dynamodb stream for an existing dynamodb table
Hi,
I would like to enable dynamodb stream on an existing dynamodb table using cloudformation template.
I searched but could not find anything in this regard. I see there is way to enable dynamodb stream for an existing table using console but couldn't find any way to achieve same using cloudformation template. Can you help with this .
Hi, For this you can simply add the StreamSpecification parameter to your table and update the stack:
"StreamSpecification": {
"StreamViewType": "NEW_AND_OLD_IMAGES"
}
A sample table with Stream included:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"myDynamoDBTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "id",
"AttributeType": "S"
},
{
"AttributeName": "name",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "id",
"KeyType": "HASH"
}
],
"BillingMode": "PAY_PER_REQUEST",
"TableName": "testcfn",
"StreamSpecification": {
"StreamViewType": "NEW_AND_OLD_IMAGES"
}
}
}
}
}
Hi, As mentioned in the original post that the table is pre-existing.
Maybe I should have mentioned that the table is pre-existing and is not managed by cloudformation and is created manually by another team.
I need to enable the dynamodb stream option for this table using cloud formation. Let me know if any other information is required.
Yes, this is for pre-existing, you update the stack. What you failed to mention was that the table did not already belong to a stack. In that case you should use CFN Import Resource tool to import the table to a stack, then add the stream in an subsequent update.
Relevant questions
Enable dynamodb stream for an existing dynamodb table
asked 13 days agoDynamo DB Kinesis Steams Best Practice
Accepted Answerasked a year agoDynamoDB replication cross region
Accepted Answerasked 3 years agoUnable to query dynamodb table in Athena using DynamoDB Connector
Accepted Answerasked 2 years agoDynamoDB Global tables do not support stream filtering.
Accepted Answerasked 5 months agoTo stream indexes into elasticsearch from dynamodb table on insertion
asked a year agoPoint in Time Recovery on Deleted Tables
Accepted Answerasked 4 years agoDelete all records in DynamoDB
Accepted Answerasked 6 years agoImport Existing DynamoDB table schema to NoSQL workbench's Data model
asked 2 years agoHow to connect to dynamodb-local using NoSQL WorkBench for Amazon DynamoDB
asked 3 years ago
First build a CFN stack (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-new-stack.html) and then update it to apply the change.