aws-cdk-lib.aws_kinesis.IStream

interface IStream

LanguageType name
.NETAmazon.CDK.AWS.Kinesis.IStream
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awskinesis#IStream
Javasoftware.amazon.awscdk.services.kinesis.IStream
Pythonaws_cdk.aws_kinesis.IStream
TypeScript (source)aws-cdk-lib » aws_kinesis » IStream

Implemented by Stream

Obtainable from Stream.fromStreamArn(), Stream.fromStreamAttributes()

A Kinesis Stream.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.
streamArnstringThe ARN of the stream.
streamNamestringThe name of the stream.
encryptionKey?IKeyOptional KMS encryption key associated with this stream.

env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.


streamArn

Type: string

The ARN of the stream.


streamName

Type: string

The name of the stream.


encryptionKey?

Type: IKey (optional)

Optional KMS encryption key associated with this stream.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
grant(grantee, ...actions)Grant the indicated permissions on this stream to the provided IAM principal.
grantRead(grantee)Grant read permissions for this stream and its contents to an IAM principal (Role/Group/User).
grantReadWrite(grantee)Grants read/write permissions for this stream and its contents to an IAM principal (Role/Group/User).
grantWrite(grantee)Grant write permissions for this stream and its contents to an IAM principal (Role/Group/User).
metric(metricName, props?)Return stream metric based from its metric name.
metricGetRecords(props?)The number of records retrieved from the shard, measured over the specified time period.
metricGetRecordsBytes(props?)The number of bytes retrieved from the Kinesis stream, measured over the specified time period.
metricGetRecordsIteratorAgeMilliseconds(props?)The age of the last record in all GetRecords calls made against a Kinesis stream, measured over the specified time period.
metricGetRecordsLatency(props?)The time taken per GetRecords operation, measured over the specified time period.
metricGetRecordsSuccess(props?)The number of successful GetRecords operations per stream, measured over the specified time period.
metricIncomingBytes(props?)The number of bytes successfully put to the Kinesis stream over the specified time period.
metricIncomingRecords(props?)The number of records successfully put to the Kinesis stream over the specified time period.
metricPutRecordBytes(props?)The number of bytes put to the Kinesis stream using the PutRecord operation over the specified time period.
metricPutRecordLatency(props?)The time taken per PutRecord operation, measured over the specified time period.
metricPutRecordSuccess(props?)The number of successful PutRecord operations per Kinesis stream, measured over the specified time period.
metricPutRecordsBytes(props?)The number of bytes put to the Kinesis stream using the PutRecords operation over the specified time period.
metricPutRecordsFailedRecords(props?)The number of records rejected due to internal failures in a PutRecords operation per Kinesis data stream, measured over the specified time period.
metricPutRecordsLatency(props?)The time taken per PutRecords operation, measured over the specified time period.
metricPutRecordsSuccess(props?)The number of PutRecords operations where at least one record succeeded, per Kinesis stream, measured over the specified time period.
metricPutRecordsSuccessfulRecords(props?)The number of successful records in a PutRecords operation per Kinesis data stream, measured over the specified time period.
metricPutRecordsThrottledRecords(props?)The number of records rejected due to throttling in a PutRecords operation per Kinesis data stream, measured over the specified time period.
metricPutRecordsTotalRecords(props?)The total number of records sent in a PutRecords operation per Kinesis data stream, measured over the specified time period.
metricReadProvisionedThroughputExceeded(props?)The number of GetRecords calls throttled for the stream over the specified time period.
metricWriteProvisionedThroughputExceeded(props?)The number of records rejected due to throttling for the stream over the specified time period.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

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, ...actions)

public grant(grantee: IGrantable, ...actions: string[]): Grant

Parameters

  • grantee IGrantable
  • actions string

Returns

  • Grant

Grant the indicated permissions on this stream to the provided IAM principal.


grantRead(grantee)

public grantRead(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • 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)

public grantReadWrite(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • 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)

public grantWrite(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • 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, props?)

public metric(metricName: string, props?: MetricOptions): Metric

Parameters

  • metricName string — name of the stream metric.
  • props MetricOptions — properties of the metric.

Returns

  • Metric

Return stream metric based from its metric name.


metricGetRecords(props?)

public metricGetRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The number of records retrieved from the shard, measured over the specified time period.

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.


metricGetRecordsBytes(props?)

public metricGetRecordsBytes(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The number of bytes retrieved from the Kinesis stream, measured over the specified time period.

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.


metricGetRecordsIteratorAgeMilliseconds(props?)

public metricGetRecordsIteratorAgeMilliseconds(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The age of the last record in all GetRecords calls made against a Kinesis stream, measured over the specified time period.

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.


metricGetRecordsLatency(props?)

public metricGetRecordsLatency(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricGetRecordsSuccess(props?)

public metricGetRecordsSuccess(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricIncomingBytes(props?)

public metricIncomingBytes(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The number of bytes successfully put to the Kinesis stream over the specified time period.

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.


metricIncomingRecords(props?)

public metricIncomingRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The number of records successfully put to the Kinesis stream over the specified time period.

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.


metricPutRecordBytes(props?)

public metricPutRecordBytes(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordLatency(props?)

public metricPutRecordLatency(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordSuccess(props?)

public metricPutRecordSuccess(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsBytes(props?)

public metricPutRecordsBytes(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsFailedRecords(props?)

public metricPutRecordsFailedRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsLatency(props?)

public metricPutRecordsLatency(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsSuccess(props?)

public metricPutRecordsSuccess(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsSuccessfulRecords(props?)

public metricPutRecordsSuccessfulRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsThrottledRecords(props?)

public metricPutRecordsThrottledRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricPutRecordsTotalRecords(props?)

public metricPutRecordsTotalRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • 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.


metricReadProvisionedThroughputExceeded(props?)

public metricReadProvisionedThroughputExceeded(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The number of GetRecords calls throttled for the stream over the specified time period.

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


metricWriteProvisionedThroughputExceeded(props?)

public metricWriteProvisionedThroughputExceeded(props?: MetricOptions): Metric

Parameters

  • props MetricOptions — properties of the metric.

Returns

  • Metric

The number of records rejected due to throttling for the stream over the specified time period.

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.