aws_ddk_core.resources.KinesisStreamsFactory¶
- class aws_ddk_core.resources.KinesisStreamsFactory¶
Class factory create and configure Kinesis DDK resources, including Data Streams.
- __init__()¶
Methods
__init__
()data_stream
(scope, id, environment_id[, ...])Create and configure Kinesis data stream.
- static data_stream(scope: constructs.Construct, id: str, environment_id: str, encryption: Optional[aws_cdk.aws_kinesis.StreamEncryption] = None, encryption_key: Optional[aws_cdk.aws_kms.IKey] = None, retention_period: Optional[aws_ddk_core.resources.commons.Duration] = None, shard_count: Optional[int] = None, stream_mode: Optional[aws_cdk.aws_kinesis.StreamMode] = None, stream_name: Optional[str] = None, **kinesis_props: Any) aws_cdk.aws_kinesis.IStream ¶
Create and configure Kinesis data stream.
This construct allows to configure parameters of the Kinesis data stream using ddk.json configuration file depending on the environment_id in which the function is used. Supported parameters are: retention_period and shard_count.
- Parameters
scope (Construct) – Scope within which this construct is defined
id (str) – Identifier of the data stream
environment_id (str) – Identifier of the environment
encryption (Optional[StreamEncryption] = None) – The kind of server-side encryption to apply to this stream. If you choose KMS, you can specify a KMS key via encryptionKey. If encryption key is not specified, a key will automatically be created. Default: - StreamEncryption.KMS if encrypted Streams are supported in the region or StreamEncryption.UNENCRYPTED otherwise. StreamEncryption.KMS if an encryption key is supplied through the encryptionKey property
encryption_key (Optional[IKey] = None) – External KMS key to use for stream encryption. The ‘encryption’ property must be set to “Kms”. Default: - Kinesis Data Streams master key (‘/alias/aws/kinesis’)
retention_period (Optional[Duration] = None) – The number of hours for the data records that are stored in shards to remain accessible. Default: Duration.seconds(3600)
shard_count (Optional[int] = None) – The number of shards for the stream. Can only be provided if streamMode is Provisioned. Default: 1
stream_mode (Optional[StreamMode] = None) – The capacity mode of this stream. Default: StreamMode.PROVISIONED
stream_name (Optional[str] = None) – Enforces a particular physical stream name. Default: A CloudFormation generated name
**kinesis_props (Any) – Additional properties. For complete list of properties refer to CDK Documentation - Firehose Data Stream: https://docs.aws.amazon.com/cdk/api/v1/python/aws_cdk.aws_kinesis/Stream.html
- Returns
data_stream – A Kinesis Data Stream
- Return type
Stream