Skip to content

Commit 7ad8806

Browse files
authored
Fix I2530 java version checks (#2916)
1 parent e1f44d7 commit 7ad8806

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/cfnlint/rules/resources/lmbd/SnapStartEnabled.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def validate(self, runtime, path):
2626
if not isinstance(runtime, str):
2727
return []
2828

29-
if not (runtime.startswith("java")) and runtime not in ["java8.al2", "java8"]:
29+
if not (runtime.startswith("java")) or runtime in ["java8.al2", "java8"]:
3030
return []
3131

3232
return [

test/fixtures/templates/good/resources/lambda/snapstart-enabled.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,16 @@ Resources:
3939
ApplyOn: None
4040
TracingConfig:
4141
Mode: Active
42+
43+
FunctionJava8:
44+
Type: AWS::Lambda::Function
45+
Properties:
46+
Handler: index.handler
47+
Role: !GetAtt LambdaRole.Arn
48+
ReservedConcurrentExecutions: 20
49+
Code:
50+
S3Bucket: my-bucket
51+
S3Key: function.zip
52+
Runtime: java8
53+
TracingConfig:
54+
Mode: Active

0 commit comments

Comments
 (0)