Class: AWSCDK::LambdaEventSources::KinesisConsumerEventSource

Inherits:
StreamEventSource
  • Object
show all
Defined in:
lambda_event_sources/kinesis_consumer_event_source.rb

Overview

Use an Amazon Kinesis stream consumer as an event source for AWS Lambda.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream_consumer, props) ⇒ KinesisConsumerEventSource

Returns a new instance of KinesisConsumerEventSource.



10
11
12
13
14
15
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 10

def initialize(stream_consumer, props)
  props = props.is_a?(Hash) ? ::AWSCDK::LambdaEventSources::KinesisEventSourceProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(stream_consumer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa2luZXNpcy5JU3RyZWFtQ29uc3VtZXIifQ==")), "streamConsumer")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhX2V2ZW50X3NvdXJjZXMuS2luZXNpc0V2ZW50U291cmNlUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(stream_consumer, props)
end

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
22
23
24
25
26
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 17

def self.jsii_overridable_methods
  {
    :props => { kind: :property, name: "props", is_optional: false },
    :event_source_mapping_arn => { kind: :property, name: "eventSourceMappingArn", is_optional: false },
    :event_source_mapping_id => { kind: :property, name: "eventSourceMappingId", is_optional: false },
    :stream_consumer => { kind: :property, name: "streamConsumer", is_optional: false },
    :bind => { kind: :method, name: "bind", is_optional: false },
    :enrich_mapping_options => { kind: :method, name: "enrichMappingOptions", is_optional: false },
  }
end

Instance Method Details

#bind(target) ⇒ void

This method returns an undefined value.

Called by lambda.addEventSource to allow the event source to bind to this function.

Parameters:



56
57
58
59
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 56

def bind(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "target")
  jsii_call_method("bind", [target])
end

#enrich_mapping_options(options) ⇒ AWSCDK::Lambda::EventSourceMappingOptions



63
64
65
66
67
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 63

def enrich_mapping_options(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Lambda::EventSourceMappingOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkV2ZW50U291cmNlTWFwcGluZ09wdGlvbnMifQ==")), "options")
  jsii_call_method("enrichMappingOptions", [options])
end

#event_source_mapping_arnString

The ARN for this EventSourceMapping.

Returns:

  • (String)


36
37
38
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 36

def event_source_mapping_arn()
  jsii_get_property("eventSourceMappingArn")
end

#event_source_mapping_idString

The identifier for this EventSourceMapping.

Returns:

  • (String)


43
44
45
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 43

def event_source_mapping_id()
  jsii_get_property("eventSourceMappingId")
end

#propsAWSCDK::LambdaEventSources::StreamEventSourceProps



29
30
31
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 29

def props()
  jsii_get_property("props")
end

#stream_consumerAWSCDK::Kinesis::IStreamConsumer



48
49
50
# File 'lambda_event_sources/kinesis_consumer_event_source.rb', line 48

def stream_consumer()
  jsii_get_property("streamConsumer")
end