@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:53.598Z") public class Stream extends Resource implements IStream
Can be encrypted with a KMS key.
Example:
Key key = new Key(this, "MyKey"); Stream.Builder.create(this, "MyEncryptedStream") .encryption(StreamEncryption.KMS) .encryptionKey(key) .build();
Modifier and Type | Class and Description |
---|---|
static class |
Stream.Builder
A fluent builder for
Stream . |
IStream.Jsii$Default, IStream.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Stream(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Stream(software.amazon.jsii.JsiiObjectRef objRef) |
|
Stream(software.constructs.Construct scope,
java.lang.String id) |
|
Stream(software.constructs.Construct scope,
java.lang.String id,
StreamProps props) |
Modifier and Type | Method and Description |
---|---|
static IStream |
fromStreamArn(software.constructs.Construct scope,
java.lang.String id,
java.lang.String streamArn)
Import an existing Kinesis Stream provided an ARN.
|
static IStream |
fromStreamAttributes(software.constructs.Construct scope,
java.lang.String id,
StreamAttributes attrs)
Creates a Stream construct that represents an external stream.
|
IKey |
getEncryptionKey()
Optional KMS encryption key associated with this stream.
|
java.lang.String |
getStreamArn()
The ARN of the stream.
|
java.lang.String |
getStreamName()
The name of the stream.
|
Grant |
grant(IGrantable grantee,
java.lang.String... actions)
Grant the indicated permissions on this stream to the given IAM principal (Role/Group/User).
|
Grant |
grantRead(IGrantable grantee)
Grant read permissions for this stream and its contents to an IAM principal (Role/Group/User).
|
Grant |
grantReadWrite(IGrantable grantee)
Grants read/write permissions for this stream and its contents to an IAM principal (Role/Group/User).
|
Grant |
grantWrite(IGrantable grantee)
Grant write permissions for this stream and its contents to an IAM principal (Role/Group/User).
|
Metric |
metric(java.lang.String metricName)
Return stream metric based from its metric name.
|
Metric |
metric(java.lang.String metricName,
MetricOptions props)
Return stream metric based from its metric name.
|
Metric |
metricGetRecords()
The number of records retrieved from the shard, measured over the specified time period.
|
Metric |
metricGetRecords(MetricOptions props)
The number of records retrieved from the shard, measured over the specified time period.
|
Metric |
metricGetRecordsBytes()
The number of bytes retrieved from the Kinesis stream, measured over the specified time period.
|
Metric |
metricGetRecordsBytes(MetricOptions props)
The number of bytes retrieved from the Kinesis stream, measured over the specified time period.
|
Metric |
metricGetRecordsIteratorAgeMilliseconds()
The age of the last record in all GetRecords calls made against a Kinesis stream, measured over the specified time period.
|
Metric |
metricGetRecordsIteratorAgeMilliseconds(MetricOptions props)
The age of the last record in all GetRecords calls made against a Kinesis stream, measured over the specified time period.
|
Metric |
metricGetRecordsLatency()
The number of successful GetRecords operations per stream, measured over the specified time period.
|
Metric |
metricGetRecordsLatency(MetricOptions props)
The number of successful GetRecords operations per stream, measured over the specified time period.
|
Metric |
metricGetRecordsSuccess()
The number of successful GetRecords operations per stream, measured over the specified time period.
|
Metric |
metricGetRecordsSuccess(MetricOptions props)
The number of successful GetRecords operations per stream, measured over the specified time period.
|
Metric |
metricIncomingBytes()
The number of bytes successfully put to the Kinesis stream over the specified time period.
|
Metric |
metricIncomingBytes(MetricOptions props)
The number of bytes successfully put to the Kinesis stream over the specified time period.
|
Metric |
metricIncomingRecords()
The number of records successfully put to the Kinesis stream over the specified time period.
|
Metric |
metricIncomingRecords(MetricOptions props)
The number of records successfully put to the Kinesis stream over the specified time period.
|
Metric |
metricPutRecordBytes()
The number of bytes put to the Kinesis stream using the PutRecord operation over the specified time period.
|
Metric |
metricPutRecordBytes(MetricOptions props)
The number of bytes put to the Kinesis stream using the PutRecord operation over the specified time period.
|
Metric |
metricPutRecordLatency()
The time taken per PutRecord operation, measured over the specified time period.
|
Metric |
metricPutRecordLatency(MetricOptions props)
The time taken per PutRecord operation, measured over the specified time period.
|
Metric |
metricPutRecordsBytes()
The number of bytes put to the Kinesis stream using the PutRecords operation over the specified time period.
|
Metric |
metricPutRecordsBytes(MetricOptions props)
The number of bytes put to the Kinesis stream using the PutRecords operation over the specified time period.
|
Metric |
metricPutRecordsFailedRecords()
The number of records rejected due to internal failures in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsFailedRecords(MetricOptions props)
The number of records rejected due to internal failures in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsLatency()
The time taken per PutRecords operation, measured over the specified time period.
|
Metric |
metricPutRecordsLatency(MetricOptions props)
The time taken per PutRecords operation, measured over the specified time period.
|
Metric |
metricPutRecordsSuccess()
The number of PutRecords operations where at least one record succeeded, per Kinesis stream, measured over the specified time period.
|
Metric |
metricPutRecordsSuccess(MetricOptions props)
The number of PutRecords operations where at least one record succeeded, per Kinesis stream, measured over the specified time period.
|
Metric |
metricPutRecordsSuccessfulRecords()
The number of successful records in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsSuccessfulRecords(MetricOptions props)
The number of successful records in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsThrottledRecords()
The number of records rejected due to throttling in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsThrottledRecords(MetricOptions props)
The number of records rejected due to throttling in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsTotalRecords()
The total number of records sent in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordsTotalRecords(MetricOptions props)
The total number of records sent in a PutRecords operation per Kinesis data stream, measured over the specified time period.
|
Metric |
metricPutRecordSuccess()
The number of successful PutRecord operations per Kinesis stream, measured over the specified time period.
|
Metric |
metricPutRecordSuccess(MetricOptions props)
The number of successful PutRecord operations per Kinesis stream, measured over the specified time period.
|
Metric |
metricReadProvisionedThroughputExceeded()
The number of GetRecords calls throttled for the stream over the specified time period.
|
Metric |
metricReadProvisionedThroughputExceeded(MetricOptions props)
The number of GetRecords calls throttled for the stream over the specified time period.
|
Metric |
metricWriteProvisionedThroughputExceeded()
The number of records rejected due to throttling for the stream over the specified time period.
|
Metric |
metricWriteProvisionedThroughputExceeded(MetricOptions props)
The number of records rejected due to throttling for the stream over the specified time period.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected Stream(software.amazon.jsii.JsiiObjectRef objRef)
protected Stream(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Stream(software.constructs.Construct scope, java.lang.String id, StreamProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public Stream(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IStream fromStreamArn(software.constructs.Construct scope, java.lang.String id, java.lang.String streamArn)
scope
- The parent creating construct (usually `this`). This parameter is required.id
- The construct's name. This parameter is required.streamArn
- Stream ARN (i.e. arn:aws:kinesis:public static IStream fromStreamAttributes(software.constructs.Construct scope, java.lang.String id, StreamAttributes attrs)
scope
- The parent creating construct (usually `this`). This parameter is required.id
- The construct's name. This parameter is required.attrs
- Stream import properties. This parameter is required.public Grant grant(IGrantable grantee, java.lang.String... actions)
public Grant grantRead(IGrantable grantee)
If an encryption key is used, permission to ues the key to decrypt the contents of the stream will also be granted.
public Grant grantReadWrite(IGrantable grantee)
If an encryption key is used, permission to use the key for encrypt/decrypt will also be granted.
grantReadWrite
in interface IStream
grantee
- This parameter is required.public Grant grantWrite(IGrantable grantee)
If an encryption key is used, permission to ues the key to encrypt the contents of the stream will also be granted.
grantWrite
in interface IStream
grantee
- This parameter is required.public Metric metric(java.lang.String metricName, MetricOptions props)
public Metric metric(java.lang.String metricName)
public Metric metricGetRecords(MetricOptions props)
Minimum, Maximum, and Average statistics represent the records in a single GetRecords operation for the stream in the specified time period.
average
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricGetRecords
in interface IStream
props
- properties of the metric.public Metric metricGetRecords()
Minimum, Maximum, and Average statistics represent the records in a single GetRecords operation for the stream in the specified time period.
average
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricGetRecords
in interface IStream
public Metric metricGetRecordsBytes(MetricOptions props)
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.
metricGetRecordsBytes
in interface IStream
props
- properties of the metric.public Metric metricGetRecordsBytes()
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.
metricGetRecordsBytes
in interface IStream
public Metric metricGetRecordsIteratorAgeMilliseconds(MetricOptions props)
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.
metricGetRecordsIteratorAgeMilliseconds
in interface IStream
props
- properties of the metric.public Metric metricGetRecordsIteratorAgeMilliseconds()
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.
metricGetRecordsIteratorAgeMilliseconds
in interface IStream
public Metric metricGetRecordsLatency(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricGetRecordsLatency
in interface IStream
props
- properties of the metric.public Metric metricGetRecordsLatency()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricGetRecordsLatency
in interface IStream
public Metric metricGetRecordsSuccess(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricGetRecordsSuccess
in interface IStream
props
- properties of the metric.public Metric metricGetRecordsSuccess()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricGetRecordsSuccess
in interface IStream
public Metric metricIncomingBytes(MetricOptions props)
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.
metricIncomingBytes
in interface IStream
props
- properties of the metric.public Metric metricIncomingBytes()
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.
metricIncomingBytes
in interface IStream
public Metric metricIncomingRecords(MetricOptions props)
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.
metricIncomingRecords
in interface IStream
props
- properties of the metric.public Metric metricIncomingRecords()
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.
metricIncomingRecords
in interface IStream
public Metric metricPutRecordBytes(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordBytes
in interface IStream
props
- properties of the metric.public Metric metricPutRecordBytes()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordBytes
in interface IStream
public Metric metricPutRecordLatency(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordLatency
in interface IStream
props
- properties of the metric.public Metric metricPutRecordLatency()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordLatency
in interface IStream
public Metric metricPutRecordsBytes(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsBytes
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsBytes()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsBytes
in interface IStream
public Metric metricPutRecordsFailedRecords(MetricOptions props)
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.
metricPutRecordsFailedRecords
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsFailedRecords()
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.
metricPutRecordsFailedRecords
in interface IStream
public Metric metricPutRecordsLatency(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsLatency
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsLatency()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsLatency
in interface IStream
public Metric metricPutRecordsSuccess(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsSuccess
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsSuccess()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsSuccess
in interface IStream
public Metric metricPutRecordsSuccessfulRecords(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsSuccessfulRecords
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsSuccessfulRecords()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsSuccessfulRecords
in interface IStream
public Metric metricPutRecordsThrottledRecords(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsThrottledRecords
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsThrottledRecords()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsThrottledRecords
in interface IStream
public Metric metricPutRecordsTotalRecords(MetricOptions props)
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsTotalRecords
in interface IStream
props
- properties of the metric.public Metric metricPutRecordsTotalRecords()
The metric defaults to average over 5 minutes, it can be changed by passing statistic
and period
properties.
metricPutRecordsTotalRecords
in interface IStream
public Metric metricPutRecordSuccess(MetricOptions props)
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.
metricPutRecordSuccess
in interface IStream
props
- properties of the metric.public Metric metricPutRecordSuccess()
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.
metricPutRecordSuccess
in interface IStream
public Metric metricReadProvisionedThroughputExceeded(MetricOptions props)
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
metricReadProvisionedThroughputExceeded
in interface IStream
props
- properties of the metric.public Metric metricReadProvisionedThroughputExceeded()
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
metricReadProvisionedThroughputExceeded
in interface IStream
public Metric metricWriteProvisionedThroughputExceeded(MetricOptions props)
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.
metricWriteProvisionedThroughputExceeded
in interface IStream
props
- properties of the metric.public Metric metricWriteProvisionedThroughputExceeded()
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.
metricWriteProvisionedThroughputExceeded
in interface IStream
public java.lang.String getStreamArn()
getStreamArn
in interface IStream
public java.lang.String getStreamName()
getStreamName
in interface IStream
public IKey getEncryptionKey()
getEncryptionKey
in interface IStream