Skip to content

KinesisVideoStreamPool creation via python CDK?

0

I found this interesting example how KinesisVideoStreamPool was created with cdk (typescript). sample creation of chime sdk media pipelines

I'm using python & cdk and tried to do the same but it did not have the similar objects. See cdk documentation

How could I use cdk in python and create KinesisVideoStreamPool?

1 Answer
1
Accepted Answer

Based on the available information, there are currently no high-level (L2) constructs specifically for creating a KinesisVideoStreamPool in the AWS CDK for Python. The AWS CDK does provide constructs for Kinesis Video Streams, but these are limited to basic resources like CfnSignalingChannel and CfnStream.

For creating a KinesisVideoStreamPool for Amazon Chime SDK media stream pipelines, you have two options:

  1. Use the L1 (CloudFormation-level) constructs in Python CDK. These are the direct mappings to CloudFormation resources. However, the specific L1 construct for KinesisVideoStreamPool may not be available yet.

  2. Use the AWS SDK for Python (boto3) directly within a custom resource or as part of your application code. The example you referenced shows how to create a KinesisVideoStreamPool using boto3:

import boto3
from uuid import uuid4
import json

client = boto3.client("chime-sdk-media-pipelines", region_name='us-east-1')
pool_name = 'MyDemoKvsPool'

# Create a KVS pool
response = client.create_media_pipeline_kinesis_video_stream_pool(
PoolName=pool_name,
KinesisVideoStreamPoolConfiguration={
'PoolRegion': 'us-east-1',
'DataRetentionInHours': 24
},
ClientRequestToken=str(uuid4())
)

If you need to integrate this with your CDK stack, you could use a custom resource with AWS Lambda that executes this boto3 code, or you could use the AwsCustomResource construct from the CDK to make the API calls directly.

Since there are no L2 constructs for KinesisVideoStreamPool yet, you might want to check Construct Hub for community-contributed libraries or consider contributing to the CDK project if you develop a solution.
Sources
aws_cdk.aws_kinesisvideo — AWS Cloud Development Kit 2.196.0 documentation
Example code for Kinesis Video Streams pools for Amazon Chime SDK media stream pipelines - Amazon Chime SDK
aws-cdk-lib.aws_kinesisvideo module · AWS CDK

answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.