Class: AWSCDK::LambdaEventSources::SQSEventSource

Inherits:
Jsii::Object
  • Object
show all
Includes:
AWSCDK::Lambda::IEventSource
Defined in:
lambda_event_sources/sqs_event_source.rb

Overview

Use an Amazon SQS queue as an event source for AWS Lambda.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, props = nil) ⇒ SQSEventSource

Returns a new instance of SQSEventSource.

Parameters:



11
12
13
14
15
16
# File 'lambda_event_sources/sqs_event_source.rb', line 11

def initialize(queue, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::LambdaEventSources::SQSEventSourceProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "queue")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhX2V2ZW50X3NvdXJjZXMuU3FzRXZlbnRTb3VyY2VQcm9wcyJ9")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(queue, props)
end

Class Method Details

.jsii_overridable_methodsObject



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

def self.jsii_overridable_methods
  {
    :event_source_mapping_arn => { kind: :property, name: "eventSourceMappingArn", is_optional: false },
    :event_source_mapping_id => { kind: :property, name: "eventSourceMappingId", is_optional: false },
    :queue => { kind: :property, name: "queue", is_optional: false },
    :bind => { kind: :method, name: "bind", 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:



50
51
52
53
# File 'lambda_event_sources/sqs_event_source.rb', line 50

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

#event_source_mapping_arnString

The ARN for this EventSourceMapping.

Returns:

  • (String)


30
31
32
# File 'lambda_event_sources/sqs_event_source.rb', line 30

def event_source_mapping_arn()
  jsii_get_property("eventSourceMappingArn")
end

#event_source_mapping_idString

The identifier for this EventSourceMapping.

Returns:

  • (String)


37
38
39
# File 'lambda_event_sources/sqs_event_source.rb', line 37

def event_source_mapping_id()
  jsii_get_property("eventSourceMappingId")
end

#queueAWSCDK::SQS::IQueue

Returns:



42
43
44
# File 'lambda_event_sources/sqs_event_source.rb', line 42

def queue()
  jsii_get_property("queue")
end