Class: AWSCDK::Kinesis::Stream

Inherits:
Resource
  • Object
show all
Includes:
IStream
Defined in:
kinesis/stream.rb

Overview

A Kinesis stream.

Can be encrypted with a KMS key.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ Stream

Returns a new instance of Stream.

Parameters:



14
15
16
17
18
19
20
# File 'kinesis/stream.rb', line 14

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::Kinesis::StreamProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa2luZXNpcy5TdHJlYW1Qcm9wcyJ9")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.from_stream_arn(scope, id, stream_arn) ⇒ AWSCDK::Kinesis::IStream

Import an existing Kinesis Stream provided an ARN.

Parameters:

  • scope (Constructs::Construct)

    The parent creating construct (usually this).

  • id (String)

    The construct's name.

  • stream_arn (String)

    Stream ARN (i.e. arn:aws:kinesis:::stream/Foo).

Returns:



74
75
76
77
78
79
# File 'kinesis/stream.rb', line 74

def self.from_stream_arn(scope, id, stream_arn)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(stream_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "streamArn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_kinesis.Stream", "fromStreamArn", [scope, id, stream_arn])
end

.from_stream_attributes(scope, id, attrs) ⇒ AWSCDK::Kinesis::IStream

Creates a Stream construct that represents an external stream.

Parameters:

  • scope (Constructs::Construct)

    The parent creating construct (usually this).

  • id (String)

    The construct's name.

  • attrs (AWSCDK::Kinesis::StreamAttributes)

    Stream import properties.

Returns:



87
88
89
90
91
92
93
# File 'kinesis/stream.rb', line 87

def self.from_stream_attributes(scope, id, attrs)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  attrs = attrs.is_a?(Hash) ? ::AWSCDK::Kinesis::StreamAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs
  Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa2luZXNpcy5TdHJlYW1BdHRyaWJ1dGVzIn0=")), "attrs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_kinesis.Stream", "fromStreamAttributes", [scope, id, attrs])
end

.jsii_overridable_methodsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'kinesis/stream.rb', line 22

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :auto_create_policy => { kind: :property, name: "autoCreatePolicy", is_optional: false },
    :stream_arn => { kind: :property, name: "streamArn", is_optional: false },
    :stream_name => { kind: :property, name: "streamName", is_optional: false },
    :stream_ref => { kind: :property, name: "streamRef", is_optional: false },
    :encryption_key => { kind: :property, name: "encryptionKey", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_to_resource_policy => { kind: :method, name: "addToResourcePolicy", is_optional: false },
    :grant => { kind: :method, name: "grant", is_optional: false },
    :grant_read => { kind: :method, name: "grantRead", is_optional: false },
    :grant_read_write => { kind: :method, name: "grantReadWrite", is_optional: false },
    :grant_write => { kind: :method, name: "grantWrite", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_get_records => { kind: :method, name: "metricGetRecords", is_optional: false },
    :metric_get_records_bytes => { kind: :method, name: "metricGetRecordsBytes", is_optional: false },
    :metric_get_records_iterator_age_milliseconds => { kind: :method, name: "metricGetRecordsIteratorAgeMilliseconds", is_optional: false },
    :metric_get_records_latency => { kind: :method, name: "metricGetRecordsLatency", is_optional: false },
    :metric_get_records_success => { kind: :method, name: "metricGetRecordsSuccess", is_optional: false },
    :metric_incoming_bytes => { kind: :method, name: "metricIncomingBytes", is_optional: false },
    :metric_incoming_records => { kind: :method, name: "metricIncomingRecords", is_optional: false },
    :metric_put_record_bytes => { kind: :method, name: "metricPutRecordBytes", is_optional: false },
    :metric_put_record_latency => { kind: :method, name: "metricPutRecordLatency", is_optional: false },
    :metric_put_records_bytes => { kind: :method, name: "metricPutRecordsBytes", is_optional: false },
    :metric_put_records_failed_records => { kind: :method, name: "metricPutRecordsFailedRecords", is_optional: false },
    :metric_put_records_latency => { kind: :method, name: "metricPutRecordsLatency", is_optional: false },
    :metric_put_records_success => { kind: :method, name: "metricPutRecordsSuccess", is_optional: false },
    :metric_put_records_successful_records => { kind: :method, name: "metricPutRecordsSuccessfulRecords", is_optional: false },
    :metric_put_records_throttled_records => { kind: :method, name: "metricPutRecordsThrottledRecords", is_optional: false },
    :metric_put_records_total_records => { kind: :method, name: "metricPutRecordsTotalRecords", is_optional: false },
    :metric_put_record_success => { kind: :method, name: "metricPutRecordSuccess", is_optional: false },
    :metric_read_provisioned_throughput_exceeded => { kind: :method, name: "metricReadProvisionedThroughputExceeded", is_optional: false },
    :metric_write_provisioned_throughput_exceeded => { kind: :method, name: "metricWriteProvisionedThroughputExceeded", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


141
142
143
# File 'kinesis/stream.rb', line 141

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_kinesis.Stream", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_to_resource_policy(statement) ⇒ AWSCDK::IAM::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 add_to_resource_policy. If the stream is imported (Stream.import), then this is a no-op.



280
281
282
283
# File 'kinesis/stream.rb', line 280

def add_to_resource_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToResourcePolicy", [statement])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



215
216
217
218
# File 'kinesis/stream.rb', line 215

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

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

Parameters:



232
233
234
235
# File 'kinesis/stream.rb', line 232

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#auto_create_policyBoolean

Indicates if a stream resource policy should automatically be created upon the first call to addToResourcePolicy.

Set by subclasses.

Returns:

  • (Boolean)


150
151
152
# File 'kinesis/stream.rb', line 150

def auto_create_policy()
  jsii_get_property("autoCreatePolicy")
end

#encryption_keyAWSCDK::KMS::IKey?

Optional KMS encryption key associated with this stream.

Returns:



178
179
180
# File 'kinesis/stream.rb', line 178

def encryption_key()
  jsii_get_property("encryptionKey")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

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.



113
114
115
# File 'kinesis/stream.rb', line 113

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


238
239
240
# File 'kinesis/stream.rb', line 238

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


252
253
254
255
256
257
# File 'kinesis/stream.rb', line 252

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


267
268
269
270
# File 'kinesis/stream.rb', line 267

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant

Grant the indicated permissions on this stream to the given IAM principal (Role/Group/User).

[disable-awslint:no-grants]

Parameters:

Returns:



292
293
294
295
296
297
298
# File 'kinesis/stream.rb', line 292

def grant(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grant", [grantee, *actions])
end

#grant_read(grantee) ⇒ AWSCDK::IAM::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.

[disable-awslint:no-grants]

Parameters:

Returns:



309
310
311
312
# File 'kinesis/stream.rb', line 309

def grant_read(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantRead", [grantee])
end

#grant_read_write(grantee) ⇒ AWSCDK::IAM::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.

[disable-awslint:no-grants]

Parameters:

Returns:



323
324
325
326
# File 'kinesis/stream.rb', line 323

def grant_read_write(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantReadWrite", [grantee])
end

#grant_write(grantee) ⇒ AWSCDK::IAM::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.

[disable-awslint:no-grants]

Parameters:

Returns:



337
338
339
340
# File 'kinesis/stream.rb', line 337

def grant_write(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantWrite", [grantee])
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return stream metric based from its metric name.

Parameters:

Returns:



347
348
349
350
351
352
# File 'kinesis/stream.rb', line 347

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_get_records(props = nil) ⇒ AWSCDK::CloudWatch::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.

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

Parameters:

Returns:



365
366
367
368
369
# File 'kinesis/stream.rb', line 365

def metric_get_records(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricGetRecords", [props])
end

#metric_get_records_bytes(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



381
382
383
384
385
# File 'kinesis/stream.rb', line 381

def metric_get_records_bytes(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricGetRecordsBytes", [props])
end

#metric_get_records_iterator_age_milliseconds(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



397
398
399
400
401
# File 'kinesis/stream.rb', line 397

def metric_get_records_iterator_age_milliseconds(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricGetRecordsIteratorAgeMilliseconds", [props])
end

#metric_get_records_latency(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



409
410
411
412
413
# File 'kinesis/stream.rb', line 409

def metric_get_records_latency(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricGetRecordsLatency", [props])
end

#metric_get_records_success(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



421
422
423
424
425
# File 'kinesis/stream.rb', line 421

def metric_get_records_success(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricGetRecordsSuccess", [props])
end

#metric_incoming_bytes(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



437
438
439
440
441
# File 'kinesis/stream.rb', line 437

def metric_incoming_bytes(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricIncomingBytes", [props])
end

#metric_incoming_records(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



453
454
455
456
457
# File 'kinesis/stream.rb', line 453

def metric_incoming_records(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricIncomingRecords", [props])
end

#metric_put_record_bytes(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



465
466
467
468
469
# File 'kinesis/stream.rb', line 465

def metric_put_record_bytes(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordBytes", [props])
end

#metric_put_record_latency(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



477
478
479
480
481
# File 'kinesis/stream.rb', line 477

def metric_put_record_latency(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordLatency", [props])
end

#metric_put_record_success(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



578
579
580
581
582
# File 'kinesis/stream.rb', line 578

def metric_put_record_success(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordSuccess", [props])
end

#metric_put_records_bytes(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



489
490
491
492
493
# File 'kinesis/stream.rb', line 489

def metric_put_records_bytes(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsBytes", [props])
end

#metric_put_records_failed_records(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



503
504
505
506
507
# File 'kinesis/stream.rb', line 503

def metric_put_records_failed_records(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsFailedRecords", [props])
end

#metric_put_records_latency(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



515
516
517
518
519
# File 'kinesis/stream.rb', line 515

def metric_put_records_latency(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsLatency", [props])
end

#metric_put_records_success(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



527
528
529
530
531
# File 'kinesis/stream.rb', line 527

def metric_put_records_success(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsSuccess", [props])
end

#metric_put_records_successful_records(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



539
540
541
542
543
# File 'kinesis/stream.rb', line 539

def metric_put_records_successful_records(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsSuccessfulRecords", [props])
end

#metric_put_records_throttled_records(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



551
552
553
554
555
# File 'kinesis/stream.rb', line 551

def metric_put_records_throttled_records(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsThrottledRecords", [props])
end

#metric_put_records_total_records(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



563
564
565
566
567
# File 'kinesis/stream.rb', line 563

def metric_put_records_total_records(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricPutRecordsTotalRecords", [props])
end

#metric_read_provisioned_throughput_exceeded(props = nil) ⇒ AWSCDK::CloudWatch::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

Parameters:

Returns:



599
600
601
602
603
# File 'kinesis/stream.rb', line 599

def metric_read_provisioned_throughput_exceeded(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricReadProvisionedThroughputExceeded", [props])
end

#metric_write_provisioned_throughput_exceeded(props = nil) ⇒ AWSCDK::CloudWatch::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.

Parameters:

Returns:



620
621
622
623
624
# File 'kinesis/stream.rb', line 620

def metric_write_provisioned_throughput_exceeded(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricWriteProvisionedThroughputExceeded", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


98
99
100
# File 'kinesis/stream.rb', line 98

def node()
  jsii_get_property("node")
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


127
128
129
# File 'kinesis/stream.rb', line 127

def physical_name()
  jsii_get_property("physicalName")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



134
135
136
# File 'kinesis/stream.rb', line 134

def stack()
  jsii_get_property("stack")
end

#stream_arnString

The ARN of the stream.

Returns:

  • (String)


157
158
159
# File 'kinesis/stream.rb', line 157

def stream_arn()
  jsii_get_property("streamArn")
end

#stream_nameString

The name of the stream.

Returns:

  • (String)


164
165
166
# File 'kinesis/stream.rb', line 164

def stream_name()
  jsii_get_property("streamName")
end

#stream_refAWSCDK::Interfaces::AWSKinesis::StreamReference

A reference to this stream.



171
172
173
# File 'kinesis/stream.rb', line 171

def stream_ref()
  jsii_get_property("streamRef")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


185
186
187
# File 'kinesis/stream.rb', line 185

def to_string()
  jsii_call_method("toString", [])
end

#with(*mixins) ⇒ Constructs::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. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


198
199
200
201
202
203
# File 'kinesis/stream.rb', line 198

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end