2.10.0 • Published 3 years ago

@cfn-modules/lambda-function v2.10.0

Weekly downloads
51
License
Apache-2.0
Repository
github
Last release
3 years ago

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
        FunctionName: '' #optional
        Description: '' # optional
        Handler: 'example.handler' # required (file must be in the `lambda-src` folder)
        MemorySize: '128' # optional
        ReservedConcurrentExecutions: '-1' # optional
        Runtime: 'nodejs14.x' # 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
        EnvironmentVariable4: '' # optional
        EnvironmentVariable5: '' # optional
        ManagedPolicyArns: '' # optional
        LayerArns: '' # optional
        ClientSgModule1: '' # optional
        ClientSgModule2: '' # optional
        ClientSgModule3: '' # optional
      TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'

Examples

Related modules

Event sources

Parameters

Migration Guides

Migrate to v2

  • The lambda-layer module is no longer supported. Replace the LayerModule parameter with a comma-delimited list of Layer ARNs to attach to the function LayerArns. Define the Lambda layer in your own template.
2.10.0

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago