Skip to content
v2.274.0

IStream Interface ​

A Kinesis Stream.

Properties ​

encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey#
Optional KMS encryption key associated with this stream.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
streamArnstringstream_arnstrstreamArnStringStreamArnstringStreamArn*stringrequired#
The ARN of the stream.
streamNamestringstream_namestrstreamNameStringStreamNamestringStreamName*stringrequired#
The name of the stream.
streamRefStreamReferencestream_refStreamReferencestreamRefStreamReferenceStreamRefStreamReferenceStreamRefStreamReferencerequired#
A reference to a Stream resource.

Methods ​

addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResultdef add_to_resource_policy(self, statement: PolicyStatement) -> AddToResourcePolicyResultpublic AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)public AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)func AddToResourcePolicy(Statement PolicyStatement) AddToResourcePolicyResult#
Adds a statement to the IAM resource policy associated with this stream.

If this stream was created in this stack (new Stream), a resource policy will be automatically created upon the first call to addToResourcePolicy. If the stream is imported (Stream.import), then this is a no-op.

applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) Grant#
Grant the indicated permissions on this stream to the provided IAM principal.
grantRead(grantee: IGrantable): Grantdef grant_read(self, grantee: IGrantable) -> Grantpublic Grant grantRead(IGrantable grantee)public Grant GrantRead(IGrantable grantee)func GrantRead(Grantee IGrantable) Grant#
Grant read permissions for this stream and its contents to an IAM principal (Role/Group/User).

If an encryption key is used, permission to ues the key to decrypt the contents of the stream will also be granted.

grantReadWrite(grantee: IGrantable): Grantdef grant_read_write(self, grantee: IGrantable) -> Grantpublic Grant grantReadWrite(IGrantable grantee)public Grant GrantReadWrite(IGrantable grantee)func GrantReadWrite(Grantee IGrantable) Grant#
Grants read/write permissions for this stream and its contents to an IAM principal (Role/Group/User).

If an encryption key is used, permission to use the key for encrypt/decrypt will also be granted.

grantWrite(grantee: IGrantable): Grantdef grant_write(self, grantee: IGrantable) -> Grantpublic Grant grantWrite(IGrantable grantee)public Grant GrantWrite(IGrantable grantee)func GrantWrite(Grantee IGrantable) Grant#
Grant write permissions for this stream and its contents to an IAM principal (Role/Group/User).

If an encryption key is used, permission to ues the key to encrypt the contents of the stream will also be granted.

metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return stream metric based from its metric name.
2 parameters

Parameters

  • metricNamemetric_namemetricNamemetricNameMetricName — name of the stream metric.
  • propspropspropspropsProps — properties of the metric.
metricGetRecords(props?: MetricOptions): Metricdef metric_get_records(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricGetRecords(MetricOptions props)public Metric MetricGetRecords(MetricOptions? props = null)func MetricGetRecords(Props MetricOptions) Metric#
The number of records retrieved from the shard, measured over the specified time period.
notes · 1 parameter

Minimum, Maximum, and Average statistics represent the records in a single GetRecords operation for the stream in the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

Parameters

  • propspropspropspropsProps — properties of the metric.
metricGetRecordsBytes(props?: MetricOptions): Metricdef metric_get_records_bytes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricGetRecordsBytes(MetricOptions props)public Metric MetricGetRecordsBytes(MetricOptions? props = null)func MetricGetRecordsBytes(Props MetricOptions) Metric#
The number of bytes retrieved from the Kinesis stream, measured over the specified time period.
notes · 1 parameter

Minimum, Maximum, and Average statistics represent the bytes in a single GetRecords operation for the stream in the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

Parameters

  • propspropspropspropsProps — properties of the metric.
metricGetRecordsIteratorAgeMilliseconds(props?: MetricOptions): Metricdef metric_get_records_iterator_age_milliseconds(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricGetRecordsIteratorAgeMilliseconds(MetricOptions props)public Metric MetricGetRecordsIteratorAgeMilliseconds(MetricOptions? props = null)func MetricGetRecordsIteratorAgeMilliseconds(Props MetricOptions) Metric#
The age of the last record in all GetRecords calls made against a Kinesis stream, measured over the specified time period.
notes · 1 parameter

Age is the difference between the current time and when the last record of the GetRecords call was written to the stream. The Minimum and Maximum statistics can be used to track the progress of Kinesis consumer applications. A value of zero indicates that the records being read are completely caught up with the stream.

The metric defaults to maximum over 5 minutes, it can be changed by passing statistic and period properties.

Parameters

  • propspropspropspropsProps — properties of the metric.
metricGetRecordsLatency(props?: MetricOptions): Metricdef metric_get_records_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricGetRecordsLatency(MetricOptions props)public Metric MetricGetRecordsLatency(MetricOptions? props = null)func MetricGetRecordsLatency(Props MetricOptions) Metric#
The time taken per GetRecords operation, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricGetRecordsSuccess(props?: MetricOptions): Metricdef metric_get_records_success(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricGetRecordsSuccess(MetricOptions props)public Metric MetricGetRecordsSuccess(MetricOptions? props = null)func MetricGetRecordsSuccess(Props MetricOptions) Metric#
The number of successful GetRecords operations per stream, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricIncomingBytes(props?: MetricOptions): Metricdef metric_incoming_bytes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIncomingBytes(MetricOptions props)public Metric MetricIncomingBytes(MetricOptions? props = null)func MetricIncomingBytes(Props MetricOptions) Metric#
The number of bytes successfully put to the Kinesis stream over the specified time period.
notes · 1 parameter

This metric includes bytes from PutRecord and PutRecords operations. Minimum, Maximum, and Average statistics represent the bytes in a single put operation for the stream in the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

Parameters

  • propspropspropspropsProps — properties of the metric.
metricIncomingRecords(props?: MetricOptions): Metricdef metric_incoming_records(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIncomingRecords(MetricOptions props)public Metric MetricIncomingRecords(MetricOptions? props = null)func MetricIncomingRecords(Props MetricOptions) Metric#
The number of records successfully put to the Kinesis stream over the specified time period.
notes · 1 parameter

This metric includes record counts from PutRecord and PutRecords operations. Minimum, Maximum, and Average statistics represent the records in a single put operation for the stream in the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordBytes(props?: MetricOptions): Metricdef metric_put_record_bytes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordBytes(MetricOptions props)public Metric MetricPutRecordBytes(MetricOptions? props = null)func MetricPutRecordBytes(Props MetricOptions) Metric#
The number of bytes put to the Kinesis stream using the PutRecord operation over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordLatency(props?: MetricOptions): Metricdef metric_put_record_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordLatency(MetricOptions props)public Metric MetricPutRecordLatency(MetricOptions? props = null)func MetricPutRecordLatency(Props MetricOptions) Metric#
The time taken per PutRecord operation, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsBytes(props?: MetricOptions): Metricdef metric_put_records_bytes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsBytes(MetricOptions props)public Metric MetricPutRecordsBytes(MetricOptions? props = null)func MetricPutRecordsBytes(Props MetricOptions) Metric#
The number of bytes put to the Kinesis stream using the PutRecords operation over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsFailedRecords(props?: MetricOptions): Metricdef metric_put_records_failed_records(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsFailedRecords(MetricOptions props)public Metric MetricPutRecordsFailedRecords(MetricOptions? props = null)func MetricPutRecordsFailedRecords(Props MetricOptions) Metric#
The number of records rejected due to internal failures in a PutRecords operation per Kinesis data stream, measured over the specified time period.

Occasional internal failures are to be expected and should be retried.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsLatency(props?: MetricOptions): Metricdef metric_put_records_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsLatency(MetricOptions props)public Metric MetricPutRecordsLatency(MetricOptions? props = null)func MetricPutRecordsLatency(Props MetricOptions) Metric#
The time taken per PutRecords operation, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsSuccess(props?: MetricOptions): Metricdef metric_put_records_success(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsSuccess(MetricOptions props)public Metric MetricPutRecordsSuccess(MetricOptions? props = null)func MetricPutRecordsSuccess(Props MetricOptions) Metric#
The number of PutRecords operations where at least one record succeeded, per Kinesis stream, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsSuccessfulRecords(props?: MetricOptions): Metricdef metric_put_records_successful_records(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsSuccessfulRecords(MetricOptions props)public Metric MetricPutRecordsSuccessfulRecords(MetricOptions? props = null)func MetricPutRecordsSuccessfulRecords(Props MetricOptions) Metric#
The number of successful records in a PutRecords operation per Kinesis data stream, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsThrottledRecords(props?: MetricOptions): Metricdef metric_put_records_throttled_records(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsThrottledRecords(MetricOptions props)public Metric MetricPutRecordsThrottledRecords(MetricOptions? props = null)func MetricPutRecordsThrottledRecords(Props MetricOptions) Metric#
The number of records rejected due to throttling in a PutRecords operation per Kinesis data stream, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordsTotalRecords(props?: MetricOptions): Metricdef metric_put_records_total_records(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordsTotalRecords(MetricOptions props)public Metric MetricPutRecordsTotalRecords(MetricOptions? props = null)func MetricPutRecordsTotalRecords(Props MetricOptions) Metric#
The total number of records sent in a PutRecords operation per Kinesis data stream, measured over the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricPutRecordSuccess(props?: MetricOptions): Metricdef metric_put_record_success(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricPutRecordSuccess(MetricOptions props)public Metric MetricPutRecordSuccess(MetricOptions? props = null)func MetricPutRecordSuccess(Props MetricOptions) Metric#
The number of successful PutRecord operations per Kinesis stream, measured over the specified time period.

Average reflects the percentage of successful writes to a stream.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

1 parameter

Parameters

  • propspropspropspropsProps — properties of the metric.
metricReadProvisionedThroughputExceeded(props?: MetricOptions): Metricdef metric_read_provisioned_throughput_exceeded(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricReadProvisionedThroughputExceeded(MetricOptions props)public Metric MetricReadProvisionedThroughputExceeded(MetricOptions? props = null)func MetricReadProvisionedThroughputExceeded(Props MetricOptions) Metric#
The number of GetRecords calls throttled for the stream over the specified time period.
notes · 1 parameter

The most commonly used statistic for this metric is Average.

When the Minimum statistic has a value of 1, all records were throttled for the stream during the specified time period.

When the Maximum statistic has a value of 0 (zero), no records were throttled for the stream during the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties

Parameters

  • propspropspropspropsProps — properties of the metric.
metricWriteProvisionedThroughputExceeded(props?: MetricOptions): Metricdef metric_write_provisioned_throughput_exceeded(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricWriteProvisionedThroughputExceeded(MetricOptions props)public Metric MetricWriteProvisionedThroughputExceeded(MetricOptions? props = null)func MetricWriteProvisionedThroughputExceeded(Props MetricOptions) Metric#
The number of records rejected due to throttling for the stream over the specified time period.
notes · 1 parameter

This metric includes throttling from PutRecord and PutRecords operations.

When the Minimum statistic has a non-zero value, records were being throttled for the stream during the specified time period.

When the Maximum statistic has a value of 0 (zero), no records were being throttled for the stream during the specified time period.

The metric defaults to average over 5 minutes, it can be changed by passing statistic and period properties.

Parameters

  • propspropspropspropsProps — properties of the metric.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining