Sha256: f2288b79aa09d77e65bef4a896fa818500d1d25a8c9691e76ce763387ebc04d9

Contents?: true

Size: 993 Bytes

Versions: 136

Compression:

Stored size: 993 Bytes

Contents

# Note the Lambda function timeout must be less than or equal to the sqs queue default timeout.
module Jets::Resource::Lambda
  class EventSourceMapping < Jets::Resource::Base
    def initialize(props={})
      @props = props # associated_properties from dsl.rb
    end

    def definition
      # CloudFormation Docs: https://amzn.to/2WM6165
      properties = {
        # batch_size: 10, # Defaults: Kinesis 100, DynamoDB Streams: 100, SQS: 10
        # enabled: boolean,
        # event_source_arn: string, # required
        function_name: "!Ref {namespace}LambdaFunction",
        # starting_position: string # reqiured for Required for Amazon Kinesis and Amazon DynamoDB Streams sources
      }
      properties.merge!(@props)

      {
        event_source_mapping_logical_id => {
          type: "AWS::Lambda::EventSourceMapping",
          properties: properties
        }
      }
    end

    def event_source_mapping_logical_id
      "{namespace}EventSourceMapping"
    end
  end
end

Version data entries

136 entries across 136 versions & 3 rubygems

Version Path
jets-1.9.0 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.14 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.13 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.12 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.11 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.10 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.9 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.8 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.7 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.6 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.5 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.4 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.3 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.2 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.1 lib/jets/resource/lambda/event_source_mapping.rb
jets-1.8.0 lib/jets/resource/lambda/event_source_mapping.rb