AWS CDK Kinesis Constructs

1.204.0 · maintenance · verified Fri Apr 17

The AWS Cloud Development Kit (CDK) Construct Library for AWS Kinesis provides high-level constructs for defining Kinesis streams using familiar programming languages. This entry specifically targets version 1.204.0, which is part of the v1 branch of the AWS CDK. The AWS CDK typically has frequent minor releases (often weekly or bi-weekly) and less frequent major releases (e.g., v1 to v2), with v2 being the currently recommended and actively developed version.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a basic Kinesis Data Stream with a single shard and 24-hour retention using AWS CDK v1 constructs. To run this, you will also need to have `aws-cdk.core` installed (`pip install aws-cdk.core`).

import aws_cdk as cdk
from aws_cdk import aws_kinesis as kinesis
from constructs import Construct

class MyKinesisStack(cdk.Stack):
    def __init__(self, scope: Construct, id: str, **kwargs) -> None:
        super().__init__(scope, id, **kwargs)

        # Create a Kinesis Data Stream
        kinesis.Stream(self, "MyCDKStream",
                       stream_name="MyCDKPythonStream",
                       shard_count=1,
                       retention_period=cdk.Duration.hours(24))

app = cdk.App()
MyKinesisStack(app, "MyKinesisStack")
app.synth()

view raw JSON →