Sha256: 0bb5b697d599defbd6e5d5889269c63649040a29b1918c0d40fdacc18b285169

Contents?: true

Size: 1.07 KB

Versions: 31

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

CloudFormation do
  DESCRIPTION ||= 'lambda description'

  Description DESCRIPTION

  Parameter('Role') { Type 'String' }

  Resource('LambdaFunction') do
    Type 'AWS::Lambda::Function'
    Property('Handler', 'index.handler')
    Property('Role', Ref('Role'))
    Property('Code',
             S3Bucket: 'lambda-functions',
             S3Key: 'amilookup.zip')
    Property('Runtime', 'nodejs')
    Property('Timeout', '25')
  end

  Resource('EventSourceMapping') do
    Type 'AWS::Lambda::EventSourceMapping'
    Property('EventSourceArn', FnJoin('', ['arn:aws:kinesis:', Ref('AWS::Region'), ':', Ref('AWS::AccountId'), ':stream/test']))
    Property('FunctionName', FnGetAtt('LambdaFunction', 'Arn'))
    Property('StartingPosition', 'TRIM_HORIZON')
  end

  Resource('LambdaInvokePermission') do
    Type 'AWS::Lambda::Permission'
    Property('FunctionName', FnGetAtt('LambdaFunction', 'Arn'))
    Property('Action', ['lambda:InvokeFunction'])
    Property('Principal', 's3.amazonaws.com')
    Property('SourceAccount', Ref('AWS::AccountId'))
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
cfndsl-1.7.2 sample/lambda.rb
cfndsl-1.6.0 sample/lambda.rb
cfndsl-1.5.0 sample/lambda.rb
cfndsl-1.4.0 sample/lambda.rb
cfndsl-1.3.9 sample/lambda.rb
cfndsl-1.3.8 sample/lambda.rb
cfndsl-1.3.7 sample/lambda.rb
cfndsl-1.3.6 sample/lambda.rb
cfndsl-1.3.5 sample/lambda.rb
cfndsl-1.3.4 sample/lambda.rb
cfndsl-1.3.3 sample/lambda.rb
cfndsl-1.3.2 sample/lambda.rb
cfndsl-1.3.1 sample/lambda.rb
cfndsl-1.3.0 sample/lambda.rb
cfndsl-1.2.0 sample/lambda.rb
cfndsl-1.1.1 sample/lambda.rb
cfndsl-1.1.0 sample/lambda.rb
cfndsl-1.0.6 sample/lambda.rb
cfndsl-1.0.5 sample/lambda.rb
cfndsl-1.0.4 sample/lambda.rb