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-3.0.6 lib/jets/resource/lambda/event_source_mapping.rb
jets-3.0.5 lib/jets/resource/lambda/event_source_mapping.rb
jets-3.0.4 lib/jets/resource/lambda/event_source_mapping.rb
jets-3.0.3 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.19 lib/jets/resource/lambda/event_source_mapping.rb
jets-3.0.2 lib/jets/resource/lambda/event_source_mapping.rb
jets-3.0.1 lib/jets/resource/lambda/event_source_mapping.rb
jets-3.0.0 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.18 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.17 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.16 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.15 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.14 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.13 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.12 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.11 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.10 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.9 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.8 lib/jets/resource/lambda/event_source_mapping.rb
jets-2.3.7 lib/jets/resource/lambda/event_source_mapping.rb