Repository: aws-cloudformation/cfn-lint

Issue:
E0002: Unknown exception while processing rule E2530: 'dict' object has no attribute 'startswith'
### CloudFormation Lint Version

0.82.0

### What operating system are you using?

windows 11

### Describe the bug

receive the E2530 error even though i dont have SnapStart in my lambda resource




### Expected behavior

no error

### Reproduction template

if i remove this lambda resource, it doesnt throw the error
```
  Lambda:
    Type: AWS::Lambda::Function
    DependsOn:
      - LambdaLogGroup
    Properties:
      Architectures:
        - !If
          - ConditionLambdaArmSupport
          - !Ref OSArchitechture
          - x86_64
      Code:
        S3Bucket:
          Fn::ImportValue: !Sub '${Region}-${BusinessUnit}-${Environment}-${AppName}-artifact-s3-bucket'
        S3Key: !Ref LambdaS3Key
        S3ObjectVersion: !Ref LambdaS3ObjectVersion
      Description: !Sub 'Lambda Function - ${LambdaPurpose}'
      FunctionName: !Sub '${Region}-${BusinessUnit}-${Environment}-${AppName}-lambda-${LambdaPurpose}'
      Handler: !Ref LambdaHandler
      Layers:
        - !Ref LambdaLayer
      MemorySize: !Ref LambdaMemory
      Role: !GetAtt LambdaRole.Arn
      Runtime: !Ref LambdaRuntime
      Timeout: !Ref LambdaTimeout
      VpcConfig: !If
        - ConditionVpcAttachment
        - SecurityGroupIds:
            - Fn::ImportValue: !Sub '${Region}-${BusinessUnit}-${Environment}-${AppName}-sg-${LambdaPurpose}'
          SubnetIds:
            - Fn::ImportValue: !Sub '${Region}-${BusinessUnit}-${Environment}-${VpcAttachment}-subnet-1-id'
            - Fn::ImportValue: !Sub '${Region}-${BusinessUnit}-${Environment}-${VpcAttachment}-subnet-2-id'
            - !If
              - ConditionThirdAZ
              - Fn::ImportValue: !Sub '${Region}-${BusinessUnit}-${Environment}-${VpcAttachment}-subnet-3-id'
              - !Ref AWS::NoValue
        - !Ref AWS::NoValue
      Tags:
        - Key: Name
          Value: !Sub '${Region}-${BusinessUnit}-${Environment}-${AppName}-lambda-${LambdaPurpose}'
        - Key: region-abbreviation
          Value: !Ref Region
        - Key: business-unit
          Value: !Ref BusinessUnit
        - Key: environment-type
          Value: !Ref Environment
        - Key: app-name
          Value: !Ref AppName
        - Key: service-type
          Value: !Ref Service
        - Key: cost-center
          Value: !Ref CostCenter
        - Key: compliance-type
          Value: !Ref Compliance
        - Key: owner-name
          Value: !Ref OwnerName
        - Key: owner-email-id
          Value: !Ref OwnerEmail
        - Key: patch-group
          Value: !Ref PatchGroup
        - Key: criticality-level
          Value: !Ref CriticalityLevel
        - Key: map-migrated
          Value: !Ref MapMigrated

```


Discussion:
Should have a fix out shortly.

Resolving patch:
diff --git a/src/cfnlint/rules/resources/lmbd/SnapStartEnabled.py b/src/cfnlint/rules/resources/lmbd/SnapStartEnabled.py
--- a/src/cfnlint/rules/resources/lmbd/SnapStartEnabled.py
+++ b/src/cfnlint/rules/resources/lmbd/SnapStartEnabled.py
@@ -23,7 +23,7 @@ def __init__(self):
         self.resource_property_types.append("AWS::Lambda::Function")
 
     def validate(self, runtime, path):
-        if not runtime:
+        if not isinstance(runtime, str):
             return []
 
         if not (runtime.startswith("java")) and runtime not in ["java8.al2", "java8"]:
diff --git a/src/cfnlint/rules/resources/lmbd/SnapStartSupported.py b/src/cfnlint/rules/resources/lmbd/SnapStartSupported.py
--- a/src/cfnlint/rules/resources/lmbd/SnapStartSupported.py
+++ b/src/cfnlint/rules/resources/lmbd/SnapStartSupported.py
@@ -39,6 +39,10 @@ def match_resource_properties(self, properties, _, path, cfn):
             if snap_start.get("ApplyOn") != "PublishedVersions":
                 continue
 
+            # Validate runtime is a string before using startswith
+            if not isinstance(runtime, str):
+                continue
+
             if (
                 runtime
                 and (not runtime.startswith("java"))


Test patch:
diff --git a/test/fixtures/templates/good/resources/lambda/snapstart-supported.yaml b/test/fixtures/templates/good/resources/lambda/snapstart-supported.yaml
--- a/test/fixtures/templates/good/resources/lambda/snapstart-supported.yaml
+++ b/test/fixtures/templates/good/resources/lambda/snapstart-supported.yaml
@@ -1,3 +1,6 @@
+Parameters:
+  Runtime:
+    Type: String
 Resources:
   LambdaRole:
     Type: AWS::IAM::Role
@@ -23,4 +26,19 @@ Resources:
       SnapStart:
         ApplyOn: PublishedVersions
       TracingConfig:
-        Mode: Active
\ No newline at end of file
+        Mode: Active
+
+  FunctionParameter:
+    Type: AWS::Lambda::Function
+    Properties:
+      Handler: index.handler
+      Role: !GetAtt LambdaRole.Arn
+      ReservedConcurrentExecutions: 20
+      Code:
+        S3Bucket: my-bucket
+        S3Key: function.zip
+      Runtime: !Ref Runtime
+      SnapStart:
+        ApplyOn: PublishedVersions
+      TracingConfig:
+        Mode: Active