New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@cfn-modules/lambda-function

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cfn-modules/lambda-function

AWS Lambda function with automated IAM policy generation, encryption, log group and alerting

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
64
-28.09%
Maintainers
2
Weekly downloads
 
Created
Source

Build Status NPM version

cfn-modules: AWS Lambda function

AWS Lambda function with automated IAM policy generation, encryption, log group and alerting.

Install

Install Node.js and npm first!

npm i @cfn-modules/lambda-function

Usage

The lambda source code must be in the folder lambda-src.

If you pass in a module dependency (e.g. DependencyModule1), the environment variable DEPENDENCY1_ARN inside the Lambda function will contain the ARN of the dependency.

---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'cfn-modules example'
Resources:
  Function:
    Type: 'AWS::CloudFormation::Stack'
    Properties:
      Parameters:
        AlertingModule: !GetAtt 'Alerting.Outputs.StackName' # optional
        KmsKeyModule: !GetAtt 'Key.Outputs.StackName' # optional
        VpcModule: !GetAtt 'Vpc.Outputs.StackName' # optional
        DeadLetterQueueModule: !GetAtt 'Queue.Outputs.StackName' # optional
        Description: '' # optional
        Handler: 'example.handler' # required (file must be in the `lambda-src` folder)
        MemorySize: '128' # optional
        ReservedConcurrentExecutions: '-1' # optional
        Runtime: 'nodejs8.10' # required
        Timeout: '3' # optional
        TracingConfigMode: PassThrough # optional
        LogGroupRetentionInDays: '14' # optional
        DependencyModule1: !GetAtt 'Queue.Outputs.StackName' # optional
        DependencyModule2: !GetAtt 'Table.Outputs.StackName' # optional
        DependencyModule3: '' # optional
        EnvironmentVariable1: '' # optional
        EnvironmentVariable2: '' # optional
        EnvironmentVariable3: '' # optional
      TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'

Event sources

Parameters

NameDescriptionDefaultRequired?Allowed values
AlertingModuleStack name of alerting moduleno
KmsKeyModuleStack name of kms-key moduleno
VpcModuleStack name of vpc moduleno
DeadLetterQueueModuleStack name of sqs-queue module where Lambda sends events to after the maximum number of retries was reachedno
Descriptiondescription of the functionno
HandlerThe name of the function (within your source code) that Lambda calls to start running your code (file must be in the `lambda-src` folder)yes
MemorySizeThe amount of memory, in MB, that is allocated to your Lambda functionno[128-3008] and a multiple of 64
ReservedConcurrentExecutionsThe maximum of concurrent executions you want reserved for the function (-1 means no maximum)-1no[-1, 0-N]
RuntimeThe runtime environment for the Lambda function that you are uploadingno['nodejs6.10', 'nodejs8.10', java8, 'python2.7', 'python3.6', 'dotnetcore1.0', 'dotnetcore2.0', 'go1.x']
TimeoutThe function execution time at which Lambda should terminate the function3no[1-300]
TracingConfigModeIf PassThrough, Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1". If Active, Lambda will respect any tracing header it receives from an upstream service. If no tracing header is received, Lambda will call X-Ray for a tracing decision.PassThroughno[Active, PassThrough]
LogGroupRetentionInDaysThe number of days log events are kept in CloudWatch Logs14no[1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653]
DependencyModule1Stack name of module implementing LambdaDependency to generate IAM Policy. Environment variable `DEPENDENCY1_ARN` will contain the ARN of the dependency.no
DependencyModule2Stack name of module implementing LambdaDependency to generate IAM Policy. Environment variable `DEPENDENCY2_ARN` will contain the ARN of the dependency.no
DependencyModule3Stack name of module implementing LambdaDependency to generate IAM Policy. Environment variable `DEPENDENCY2_ARN` will contain the ARN of the dependency.no
EnvironmentVariable1Optional value of environment variable `VARIABLE1`no
EnvironmentVariable2Optional value of environment variable `VARIABLE2`no
EnvironmentVariable3Optional value of environment variable `VARIABLE3`no

Keywords

cfn-modules

FAQs

Package last updated on 04 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts