Sha256: 136adcd490a5e18e3682e2b16633dfe62a87e82976784b2f06c6a034ca8a19a0

Contents?: true

Size: 988 Bytes

Versions: 15

Compression:

Stored size: 988 Bytes

Contents

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

    def definition
      # CloudFormation Docs: https://amzn.to/2WM6165
      properties = {
        # BatchSize: 10, # Defaults: Kinesis 100, DynamoDB Streams: 100, SQS: 10
        # Enabled: boolean,
        # EventSourceArn: string, # required
        FunctionName: "!Ref {namespace}LambdaFunction",
        # StartingPosition: 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

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.12 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.11 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.10 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.9 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.8 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.7 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.6 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.5 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.4 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.3 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.2 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.1 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.0 lib/jets/cfn/resource/lambda/event_source_mapping.rb
jets-5.0.0.beta1 lib/jets/cfn/resource/lambda/event_source_mapping.rb