Merge pull request #3050 from bblommers/cloudformation-support-dynamodb-streams

CloudFormation - Support DynamoDB Streams
This commit is contained in:
Steve Pulec 2020-06-11 20:58:19 -05:00 committed by GitHub
commit ee0328b0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -342,6 +342,8 @@ class Table(BaseModel):
params["throughput"] = properties["ProvisionedThroughput"]
if "LocalSecondaryIndexes" in properties:
params["indexes"] = properties["LocalSecondaryIndexes"]
if "StreamSpecification" in properties:
params["streams"] = properties["StreamSpecification"]
table = dynamodb_backends[region_name].create_table(
name=properties["TableName"], **params

View File

@ -2303,6 +2303,7 @@ def test_stack_dynamodb_resources_integration():
},
}
],
"StreamSpecification": {"StreamViewType": "KEYS_ONLY"},
},
}
},
@ -2315,6 +2316,12 @@ def test_stack_dynamodb_resources_integration():
StackName="dynamodb_stack", TemplateBody=dynamodb_template_json
)
dynamodb_client = boto3.client("dynamodb", region_name="us-east-1")
table_desc = dynamodb_client.describe_table(TableName="myTableName")["Table"]
table_desc["StreamSpecification"].should.equal(
{"StreamEnabled": True, "StreamViewType": "KEYS_ONLY",}
)
dynamodb_conn = boto3.resource("dynamodb", region_name="us-east-1")
table = dynamodb_conn.Table("myTableName")
table.name.should.equal("myTableName")