diff --git a/.travis.yml b/.travis.yml index 385fa23..37e2c64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ language: python python: - '2.7' install: -- 'pip install yamllint==1.15.0' -- 'pip install cfn-lint==0.20.2' +- 'pip install yamllint==1.19.0' +- 'pip install cfn-lint==0.25.3' script: - 'yamllint module.yml' - 'cfn-lint -i W3002 -t module.yml' diff --git a/README.md b/README.md index 643264f..feca7d8 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Resources: Handler: 'example.handler' # required (file must be in the `lambda-src` folder) MemorySize: '128' # optional ReservedConcurrentExecutions: '-1' # optional - Runtime: 'nodejs10.x' # required + Runtime: 'nodejs12.x' # required Timeout: '3' # optional TracingConfigMode: PassThrough # optional LogGroupRetentionInDays: '14' # optional @@ -154,7 +154,7 @@ Resources: The runtime environment for the Lambda function that you are uploading no - ['dotnetcore1.0', 'dotnetcore2.1', 'go1.x', 'java8', 'nodejs10.x', 'nodejs8.10', 'python2.7', 'python3.6', 'python3.7', 'ruby2.5'] + ['nodejs12.x', 'nodejs10.x', 'nodejs8.10', 'python3.8', 'python3.7', 'python3.6', 'python2.7', 'ruby2.5', 'java11', 'java8', 'dotnetcore2.1', 'go1.x'] Timeout diff --git a/module.yml b/module.yml index 842caac..60bc5e8 100644 --- a/module.yml +++ b/module.yml @@ -70,7 +70,7 @@ Parameters: Runtime: Description: 'The runtime environment for the Lambda function that you are uploading' Type: String - AllowedValues: ['dotnetcore1.0', 'dotnetcore2.1', 'go1.x', 'java8', 'nodejs10.x', 'nodejs8.10', 'python2.7', 'python3.6', 'python3.7', 'ruby2.5'] + AllowedValues: ['nodejs12.x', 'nodejs10.x', 'nodejs8.10', 'python3.8', 'python3.7', 'python3.6', 'python2.7', 'ruby2.5', 'java11', 'java8', 'dotnetcore2.1', 'go1.x'] Timeout: Description: 'The function execution time at which Lambda should terminate the function' Type: Number @@ -145,6 +145,7 @@ Conditions: HasClientSgModule1: !Not [!Equals [!Ref ClientSgModule1, '']] HasClientSgModule2: !Not [!Equals [!Ref ClientSgModule2, '']] HasClientSgModule3: !Not [!Equals [!Ref ClientSgModule3, '']] + HasTracingConfigModeActive: !Equals [!Ref TracingConfigMode, Active] Resources: Role: Type: 'AWS::IAM::Role' @@ -175,6 +176,23 @@ Resources: - 'ec2:DeleteNetworkInterface' Resource: '*' - !Ref 'AWS::NoValue' + - !If + - HasDeadLetterQueueModule + - Effect: Allow + Action: 'sqs:SendMessage' + Resource: {'Fn::ImportValue': !Sub '${DeadLetterQueueModule}-Arn'} + - !Ref 'AWS::NoValue' + - !If + - HasTracingConfigModeActive + - Effect: Allow + Action: + - 'xray:PutTraceSegments' + - 'xray:PutTelemetryRecords' + - 'xray:GetSamplingRules' + - 'xray:GetSamplingTargets' + - 'xray:GetSamplingStatisticSummaries' + Resource: '*' + - !Ref 'AWS::NoValue' - !If - HasDependencyModule1 - Effect: Allow @@ -284,7 +302,7 @@ Outputs: ModuleId: Value: 'lambda-function' ModuleVersion: - Value: '2.5.0' + Value: '2.6.0' StackName: Value: !Ref 'AWS::StackName' Arn: diff --git a/package.json b/package.json index ae335ce..1dfd38e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cfn-modules/lambda-function", - "version": "2.5.0", + "version": "2.6.0", "description": "AWS Lambda function with automated IAM policy generation, encryption, log group and alerting", "author": "Michael Wittig ", "license": "Apache-2.0", diff --git a/test/defaults.yml b/test/defaults.yml index b6bd830..fbeb87d 100644 --- a/test/defaults.yml +++ b/test/defaults.yml @@ -7,5 +7,5 @@ Resources: Properties: Parameters: Handler: 'defaults.handler' - Runtime: 'nodejs10.x' + Runtime: 'nodejs12.x' TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml' diff --git a/test/layer.yml b/test/layer.yml index 1916f87..00f3db3 100644 --- a/test/layer.yml +++ b/test/layer.yml @@ -18,6 +18,6 @@ Resources: Properties: Parameters: Handler: 'defaults.handler' - Runtime: 'nodejs10.x' + Runtime: 'nodejs12.x' LayerArns: !Ref Layer TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml' diff --git a/test/named.yml b/test/named.yml index e3b0975..9746196 100644 --- a/test/named.yml +++ b/test/named.yml @@ -7,6 +7,6 @@ Resources: Properties: Parameters: Handler: 'defaults.handler' - Runtime: 'nodejs10.x' + Runtime: 'nodejs12.x' FunctionName: 'NamedLambda' TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'