Sha256: b61d04c54557940b76ae1ddbe022b03fdb03330d6d7b228e82f7e170bac1960c

Contents?: true

Size: 1.06 KB

Versions: 15

Compression:

Stored size: 1.06 KB

Contents

CloudFormation do
  DESCRIPTION ||= 'lambda description'.freeze

  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

15 entries across 15 versions & 1 rubygems

Version Path
cfndsl-0.8.6 sample/lambda.rb
cfndsl-0.8.5 sample/lambda.rb
cfndsl-0.8.4 sample/lambda.rb
cfndsl-0.8.3 sample/lambda.rb
cfndsl-0.8.2 sample/lambda.rb
cfndsl-0.8.1 sample/lambda.rb
cfndsl-0.7.0 sample/lambda.rb
cfndsl-0.6.2 sample/lambda.rb
cfndsl-0.6.1 sample/lambda.rb
cfndsl-0.6.0 sample/lambda.rb
cfndsl-0.5.2 sample/lambda.rb
cfndsl-0.5.1 sample/lambda.rb
cfndsl-0.5.0 sample/lambda.rb
cfndsl-0.5.1.pre sample/lambda.rb
cfndsl-0.5.0.pre sample/lambda.rb