
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@cfn-modules/lambda-function
Advanced tools
AWS Lambda function with automated IAM policy generation, encryption, log group and alerting
AWS Lambda function with automated IAM policy generation, encryption, log group and alerting.
Install Node.js and npm first!
npm i @cfn-modules/lambda-function
The lambda source code must be in the folder
lambdas.
If you pass in a module dependency (e.g.
ModuleDependency1), the environment variableDEPENDENCY1_ARNinside 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 lambdas folder)
MemorySize: 128 # optional
ReservedConcurrentExecutions: -1 # optional
Runtime: 'nodejs8.10' # required
Timeout: 3 # optional
TracingConfigMode: PassThrough # optional
LogGroupRetentionInDays: 14 # optional
ModuleDependency1: !GetAtt 'Queue.Outputs.StackName' # optional
ModuleDependency2: !GetAtt 'Table.Outputs.StackName' # optional
ModuleDependency3: '' # optional
AllowApiGatewayAccess: true # optional
TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'
| Name | Description | Default | Required? | Allowed values |
|---|---|---|---|---|
| AlertingModule | Stack name of alerting module | no | ||
| KmsKeyModule | Stack name of kms-key module | no | ||
| VpcModule | Stack name of vpc module | no | ||
| DeadLetterQueueModule | Stack name of sqs-queue module where Lambda sends events to after the maximum number of retries was reached | no | ||
| Description | description of the function | no | ||
| Handler | The name of the function (within your source code) that Lambda calls to start running your code | yes | ||
| MemorySize | The amount of memory, in MB, that is allocated to your Lambda function | no | [128-3008] and a multiple of 64 | |
| ReservedConcurrentExecutions | The maximum of concurrent executions you want reserved for the function (-1 means no maximum) | -1 | no | [-1, 0-N] |
| Runtime | The runtime environment for the Lambda function that you are uploading | no | ['nodejs6.10', 'nodejs8.10', java8, 'python2.7', 'python3.6', 'dotnetcore1.0', 'dotnetcore2.0', 'go1.x'] | |
| Timeout | The function execution time at which Lambda should terminate the function | 3 | no | [1-300] |
| TracingConfigMode | If 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. | PassThrough | no | [Active, PassThrough] |
| LogGroupRetentionInDays | The number of days log events are kept in CloudWatch Logs | 14 | no | [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653] |
| ModuleDependency1 | Stack name of module implementing LambdaDependency to generate IAM Policy | no | ||
| ModuleDependency2 | Stack name of module implementing LambdaDependency to generate IAM Policy | no | ||
| ModuleDependency3 | Stack name of module implementing LambdaDependency to generate IAM Policy | no | ||
| AllowApiGatewayAccess | Allow invoke access from API Gateways from the same AWS account and region? | true | no | [true, false] |
FAQs
AWS Lambda function with automated IAM policy generation, encryption, log group and alerting
The npm package @cfn-modules/lambda-function receives a total of 60 weekly downloads. As such, @cfn-modules/lambda-function popularity was classified as not popular.
We found that @cfn-modules/lambda-function demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.