@cfn-modules/lambda-function
Advanced tools
+7
-8
@@ -52,6 +52,2 @@ --- | ||
| Default: '' | ||
| LayerModule: | ||
| Description: 'Optional stack name of lambda-layer module.' | ||
| Type: String | ||
| Default: '' | ||
| Description: | ||
@@ -120,2 +116,6 @@ Description: 'Optional description of the function' | ||
| Default: '' | ||
| LayerArns: | ||
| Description: 'Optional comma-delimited list of Layer ARNs to attach to the function' | ||
| Type: String | ||
| Default: '' | ||
| Conditions: | ||
@@ -125,3 +125,2 @@ HasAlertingModule: !Not [!Equals [!Ref AlertingModule, '']] | ||
| HasDeadLetterQueueModule: !Not [!Equals [!Ref DeadLetterQueueModule, '']] | ||
| HasLayerModule: !Not [!Equals [!Ref LayerModule, '']] | ||
| HasReservedConcurrentExecutions: !Not [!Equals [!Ref ReservedConcurrentExecutions, -1]] | ||
@@ -133,2 +132,3 @@ HasVpcModule: !Not [!Equals [!Ref VpcModule, '']] | ||
| HasManagedPolicyArns: !Not [!Equals [!Ref ManagedPolicyArns, '']] | ||
| HasLayerArns: !Not [!Equals [!Ref LayerArns, '']] | ||
| Resources: | ||
@@ -215,4 +215,3 @@ Role: | ||
| - !Ref 'AWS::NoValue' | ||
| Layers: | ||
| - !If [HasLayerModule, {'Fn::ImportValue': !Sub '${LayerModule}-Arn'}, !Ref 'AWS::NoValue'] | ||
| Layers: !If [HasLayerArns, !Split [',', !Ref LayerArns], !Ref 'AWS::NoValue'] | ||
| ErrorsTooHighAlarm: | ||
@@ -260,3 +259,3 @@ Condition: HasAlertingModule | ||
| ModuleVersion: | ||
| Value: '1.3.1' | ||
| Value: '2.0.0' | ||
| StackName: | ||
@@ -263,0 +262,0 @@ Value: !Ref 'AWS::StackName' |
+1
-1
| { | ||
| "name": "@cfn-modules/lambda-function", | ||
| "version": "1.3.1", | ||
| "version": "2.0.0", | ||
| "description": "AWS Lambda function with automated IAM policy generation, encryption, log group and alerting", | ||
@@ -5,0 +5,0 @@ "author": "Michael Wittig <michael@widdix.de>", |
+15
-8
@@ -35,3 +35,2 @@ [](https://travis-ci.org/cfn-modules/lambda-function) | ||
| DeadLetterQueueModule: !GetAtt 'Queue.Outputs.StackName' # optional | ||
| LayerModule: !GetAtt 'Layer.Outputs.StackName' # optional | ||
| Description: '' # optional | ||
@@ -52,2 +51,3 @@ Handler: 'example.handler' # required (file must be in the `lambda-src` folder) | ||
| ManagedPolicyArns: '' # optional | ||
| LayerArns: '' # optional | ||
| TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml' | ||
@@ -106,9 +106,2 @@ ``` | ||
| <tr> | ||
| <td>LayerModule</td> | ||
| <td>Stack name of <a href="https://www.npmjs.com/package/@cfn-modules/lambda-layer">lambda-layer module</a></td> | ||
| <td></td> | ||
| <td>no</td> | ||
| <td></td> | ||
| </tr> | ||
| <tr> | ||
| <td>Description</td> | ||
@@ -218,3 +211,17 @@ <td>description of the function</td> | ||
| </tr> | ||
| <tr> | ||
| <td>LayerArns</td> | ||
| <td>Comma-delimited list of Layer ARNs to attach to the function</td> | ||
| <td></td> | ||
| <td>no</td> | ||
| <td></td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| ## 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. |
+5
-6
@@ -11,8 +11,7 @@ --- | ||
| Layer: | ||
| Type: 'AWS::CloudFormation::Stack' | ||
| Type: 'AWS::Lambda::LayerVersion' | ||
| Properties: | ||
| Parameters: | ||
| ContentBucket: !Ref ContentBucket | ||
| ContentKey: !Ref ContentKey | ||
| TemplateURL: './node_modules/@cfn-modules/lambda-layer/module.yml' | ||
| Content: | ||
| S3Bucket: !Ref ContentBucket | ||
| S3Key: !Ref ContentKey | ||
| Function: | ||
@@ -24,3 +23,3 @@ Type: 'AWS::CloudFormation::Stack' | ||
| Runtime: 'nodejs8.10' | ||
| LayerModule: !GetAtt 'Layer.Outputs.StackName' | ||
| LayerArns: !Ref Layer | ||
| TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml' |
@@ -7,4 +7,3 @@ { | ||
| "@cfn-modules/test": "0.4.0", | ||
| "@cfn-modules/s3-bucket": "1.1.0", | ||
| "@cfn-modules/lambda-layer": "1.0.0", | ||
| "@cfn-modules/s3-bucket": "1.2.0", | ||
| "@cfn-modules/lambda-function": "file:../" | ||
@@ -11,0 +10,0 @@ }, |
34257
0.05%224
3.23%