Repository: aws-cloudformation/cfn-lint

Issue:
(AWS::Lambda::Function.FileSystemConfigs.LocalMountPath) `The local mount path must start with /mnt/ and be a valid absolute path.` not being checked
### Is this feature request related to a new rule or cfn-lint capabilities?

New capability

### Describe the feature you'd like to request

The following CFN template doesn't check the path for `LocalMountPath`:

```yaml
LambdaFunction:
  Type: AWS::Lambda::Function
  Properties:
    FileSystemConfigs:
      - Arn: <arn>
        LocalMountPath: /efs
```

According to the Lambda GUI the path needs to start with `/mnt/`:

```
Local mount path
Only absolute paths are supported.
The local mount path must start with /mnt/ and be a valid absolute path.
```

### Describe the solution you'd like

cfn-lint should give you a notification if the path doesn't start with `/mnt/`:

`The local mount path must start with /mnt/ and be a valid absolute path.`

### Additional context

cfn-lint v0.79.7

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change


Discussion:
Here is the official documentation:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html

```
LocalMountPath
The path where the function can access the file system, starting with /mnt/.

Required: Yes

Type: String

Maximum: 160

Pattern: ^/mnt/[a-zA-Z0-9-_.]+$

Update requires: No interruption
```

Resolving patch:
diff --git a/src/cfnlint/rules/resources/properties/AllowedPattern.py b/src/cfnlint/rules/resources/properties/AllowedPattern.py
--- a/src/cfnlint/rules/resources/properties/AllowedPattern.py
+++ b/src/cfnlint/rules/resources/properties/AllowedPattern.py
@@ -81,18 +81,16 @@ def check_value(self, value, path, property_name, **kwargs):
 
         return matches
 
-    def check(self, cfn, properties, value_specs, property_specs, path):
+    def check(self, cfn, properties, property_specs, path):
         """Check itself"""
         matches = []
         for p_value, p_path in properties.items_safe(path[:]):
             for prop in p_value:
-                if prop in value_specs:
-                    value = value_specs.get(prop).get("Value", {})
+                if prop in property_specs:
+                    value = property_specs.get(prop).get("Value", {})
                     if value:
                         value_type = value.get("ValueType", "")
-                        property_type = (
-                            property_specs.get("Properties").get(prop).get("Type")
-                        )
+                        property_type = property_specs.get(prop).get("Type")
                         value_specs = (
                             RESOURCE_SPECS.get(cfn.regions[0])
                             .get("ValueTypes")
@@ -128,10 +126,7 @@ def match_resource_sub_properties(self, properties, property_type, path, cfn):
             .get(property_type, {})
             .get("Properties", {})
         )
-        property_specs = (
-            RESOURCE_SPECS.get(cfn.regions[0]).get("PropertyTypes").get(property_type)
-        )
-        matches.extend(self.check(cfn, properties, specs, property_specs, path))
+        matches.extend(self.check(cfn, properties, specs, path))
 
         return matches
 
@@ -145,9 +140,6 @@ def match_resource_properties(self, properties, resource_type, path, cfn):
             .get(resource_type, {})
             .get("Properties", {})
         )
-        resource_specs = (
-            RESOURCE_SPECS.get(cfn.regions[0]).get("ResourceTypes").get(resource_type)
-        )
-        matches.extend(self.check(cfn, properties, specs, resource_specs, path))
+        matches.extend(self.check(cfn, properties, specs, path))
 
         return matches


Test patch: