lib/artifacts/lambda.js
function buildLambda(options) {
  // crawl the module path to make sure the Lambda handler path is
  // set correctly: <functionDir>/function.fn
  let handlerPath = (module.parent.parent.parent.filename).split(path.sep).slice(-2).shift();
  let fn = {
    Resources: {}
  };

  // all function parameters available as environment variables
  fn.Resources[options.name] = {
    Type: 'AWS::Lambda::Function',
    Properties: {
      Code: {
        S3Bucket: cf.ref('CodeS3Bucket'),
        S3Key: cf.join([cf.ref('CodeS3Prefix'), cf.ref('GitSha'), '.zip'])
      },
      Role: cf.if('HasDispatchSnsArn', cf.getAtt('LambdaCfnDispatchRole', 'Arn'), cf.getAtt('LambdaCfnRole', 'Arn')),
      Description: cf.stackName,
      Environment: {
        Variables: {}
      },
      Handler: handlerPath + '/function.fn'
    }
  };

  fn.Resources[options.name].Properties.Timeout = setLambdaTimeout(options.timeout);
  fn.Resources[options.name].Properties.MemorySize = setLambdaMemorySize(options.memorySize);
  fn.Resources[options.name].Properties.Runtime = setLambdaRuntine(options.runtime);

  return fn;
}
function buildLambda(options) {
  // crawl the module path to make sure the Lambda handler path is
  // set correctly: <functionDir>/function.fn
  let handlerPath = (module.parent.parent.parent.filename).split(path.sep).slice(-2).shift();
  let fn = {
    Resources: {}
  };

  // all function parameters available as environment variables
  fn.Resources[options.name] = {
    Type: 'AWS::Lambda::Function',
    Properties: {
      Code: {
        S3Bucket: cf.ref('CodeS3Bucket'),
        S3Key: cf.join([cf.ref('CodeS3Prefix'), cf.ref('GitSha'), '.zip'])
      },
      Role: cf.if('HasDispatchSnsArn', cf.getAtt('LambdaCfnDispatchRole', 'Arn'), cf.getAtt('LambdaCfnRole', 'Arn')),
      Description: cf.stackName,
      Environment: {
        Variables: {}
      },
      Handler: handlerPath + '/function.fn'
    }
  };

  fn.Resources[options.name].Properties.Timeout = setLambdaTimeout(options.timeout);
  fn.Resources[options.name].Properties.MemorySize = setLambdaMemorySize(options.memorySize);
  fn.Resources[options.name].Properties.Runtime = setLambdaRuntine(options.runtime);

  return fn;
}
function buildLambda ( options ) { // crawl the module path to make sure the Lambda handler path is // set correctly: <functionDir>/function.fn let handlerPath = ( module . parent . parent . parent . filename ) . split ( path . sep ) . slice ( - 2 ) . shift ( ) ; let fn = { Resources : { } } ; // all function parameters available as environment variables fn . Resources [ options . name ] = { Type : 'AWS::Lambda::Function' , Properties : { Code : { S3Bucket : cf . ref ( 'CodeS3Bucket' ) , S3Key : cf . join ( [ cf . ref ( 'CodeS3Prefix' ) , cf . ref ( 'GitSha' ) , '.zip' ] ) } , Role : cf . if ( 'HasDispatchSnsArn' , cf . getAtt ( 'LambdaCfnDispatchRole' , 'Arn' ) , cf . getAtt ( 'LambdaCfnRole' , 'Arn' ) ) , Description : cf . stackName , Environment : { Variables : { } } , Handler : handlerPath + '/function.fn' } } ; fn . Resources [ options . name ] . Properties . Timeout = setLambdaTimeout ( options . timeout ) ; fn . Resources [ options . name ] . Properties . MemorySize = setLambdaMemorySize ( options . memorySize ) ; fn . Resources [ options . name ] . Properties . Runtime = setLambdaRuntine ( options . runtime ) ; return fn ; }
Build configuration for lambda
This function creates

- A lambda function

@param options
@returns {{Resources: {}}}
Build configuration for lambda This function creates