interface IStream
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Kinesis.IStream |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awskinesis#IStream |
![]() | software.amazon.awscdk.services.kinesis.IStream |
![]() | aws_cdk.aws_kinesis.IStream |
![]() | aws-cdk-lib » aws_kinesis » IStream |
Implemented by
Stream
Obtainable from
Stream
.fromStreamArn()
, Stream
.fromStreamAttributes()
A Kinesis Stream.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
stream | string | The ARN of the stream. |
stream | string | The name of the stream. |
encryption | IKey | Optional KMS encryption key associated with this stream. |
env
Type:
Resource
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
Name | Description |
---|---|
add | Adds a statement to the IAM resource policy associated with this stream. |
apply | Apply the given removal policy to this resource. |
grant(grantee, ...actions) | Grant the indicated permissions on this stream to the provided IAM principal. |
grant | Grant read permissions for this stream and its contents to an IAM principal (Role/Group/User). |
grant | Grants read/write permissions for this stream and its contents to an IAM principal (Role/Group/User). |
grant | 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. |
metric | The number of records retrieved from the shard, measured over the specified time period. |
metric | The number of bytes retrieved from the Kinesis stream, measured over the specified time period. |
metric | The age of the last record in all GetRecords calls made against a Kinesis stream, measured over the specified time period. |
metric | The time taken per GetRecords operation, measured over the specified time period. |
metric | The number of successful GetRecords operations per stream, measured over the specified time period. |
metric | The number of bytes successfully put to the Kinesis stream over the specified time period. |
metric | The number of records successfully put to the Kinesis stream over the specified time period. |
metric | The number of bytes put to the Kinesis stream using the PutRecord operation over the specified time period. |
metric | The time taken per PutRecord operation, measured over the specified time period. |
metric | The number of successful PutRecord operations per Kinesis stream, measured over the specified time period. |
metric | The number of bytes put to the Kinesis stream using the PutRecords operation over the specified time period. |
metric | The number of records rejected due to internal failures in a PutRecords operation per Kinesis data stream, measured over the specified time period. |
metric | The time taken per PutRecords operation, measured over the specified time period. |
metric | The number of PutRecords operations where at least one record succeeded, per Kinesis stream, measured over the specified time period. |
metric | The number of successful records in a PutRecords operation per Kinesis data stream, measured over the specified time period. |
metric | The number of records rejected due to throttling in a PutRecords operation per Kinesis data stream, measured over the specified time period. |
metric | The total number of records sent in a PutRecords operation per Kinesis data stream, measured over the specified time period. |
metric | The number of GetRecords calls throttled for the stream over the specified time period. |
metric | The number of records rejected due to throttling for the stream over the specified time period. |
addToResourcePolicy(statement)
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
Parameters
- statement
Policy
Statement
Returns
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)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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 the indicated permissions on this stream to the provided IAM principal.
grantRead(grantee)
public grantRead(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
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
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 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
Metric
— properties of the metric.Options
Returns
Return stream metric based from its metric name.
metricGetRecords(props?)
public metricGetRecords(props?: MetricOptions): Metric
Parameters
- props
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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
Metric
— properties of the metric.Options
Returns
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.