prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/cfnlint/rules/resources/properties/AllowedPattern.py`
  Content:
  ```
  1 """
  2 Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 SPDX-License-Identifier: MIT-0
  4 """
  5 import regex as re
  6 
  7 from cfnlint.helpers import RESOURCE_SPECS
  8 from cfnlint.rules import CloudFormationLintRule, RuleMatch
  9 
  10 
  11 class AllowedPattern(CloudFormationLintRule):
  12     """Check if properties have a valid value"""
  13 
  14     id = "E3031"
  15     shortdesc = "Check if property values adhere to a specific pattern"
  16     description = "Check if properties have a valid value in case of a pattern (Regular Expression)"
  17     source_url = "https://github.com/awslabs/cfn-python-lint/blob/main/docs/cfn-resource-specification.md#allowedpattern"
  18     tags = ["resources", "property", "allowed pattern", "regex"]
  19 
  20     def __init__(self):
  21         """Init"""
  22         super().__init__()
  23         self.config_definition = {
  24             "exceptions": {
  25                 "default": [],
  26                 "type": "list",
  27                 "itemtype": "string",
  28             }
  29         }
  30         self.configure()
  31 
  32     def initialize(self, cfn):
  33         """Initialize the rule"""
  34         for resource_type_spec in RESOURCE_SPECS.get(cfn.regions[0]).get(
  35             "ResourceTypes"
  36         ):
  37             self.resource_property_types.append(resource_type_spec)
  38         for property_type_spec in RESOURCE_SPECS.get(cfn.regions[0]).get(
  39             "PropertyTypes"
  40         ):
  41             self.resource_sub_property_types.append(property_type_spec)
  42 
  43     def check_value(self, value, path, property_name, **kwargs):
  44         """Check Value"""
  45         matches = []
  46 
  47         # Get the Allowed Pattern Regex
  48         value_pattern_regex = kwargs.get("value_specs", {}).get(
  49             "AllowedPatternRegex", {}
  50         )
  51         # Get the "Human Readable" version for the error message. Optional, if not specified,
  52         # the RegEx itself is used.
  53         value_pattern = kwargs.get("value_specs", {}).get(
  54             "AllowedPattern", value_pattern_regex
  55         )
  56 
  57         if isinstance(value, (int, float)):
  58             value = str(value)
  59 
  60         if isinstance(value, str):
  61             if value_pattern_regex:
  62                 regex = re.compile(value_pattern_regex, re.ASCII)
  63 
  64                 # Ignore values with dynamic references. Simple check to prevent false-positives
  65                 # See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html
  66                 if "{{resolve:" not in value:
  67                     if not regex.match(value):
  68                         for exception in self.config.get("exceptions"):
  69                             exception_regex = re.compile(exception)
  70                             if exception_regex.match(value):
  71                                 return matches
  72                         full_path = "/".join(str(x) for x in path)
  73 
  74                         message = "{} contains invalid characters (Pattern: {}) at {}"
  75                         matches.append(
  76                             RuleMatch(
  77                                 path,
  78                                 message.format(property_name, value_pattern, full_path),
  79                             )
  80                         )
  81 
  82         return matches
  83 
  84     def check(self, cfn, properties, value_specs, property_specs, path):
  85         """Check itself"""
  86         matches = []
  87         for p_value, p_path in properties.items_safe(path[:]):
  88             for prop in p_value:
  89                 if prop in value_specs:
  90                     value = value_specs.get(prop).get("Value", {})
  91                     if value:
  92                         value_type = value.get("ValueType", "")
  93                         property_type = (
  94                             property_specs.get("Properties").get(prop).get("Type")
  95                         )
  96                         value_specs = (
  97                             RESOURCE_SPECS.get(cfn.regions[0])
  98                             .get("ValueTypes")
  99                             .get(value_type, {})
  100                         )
  101                         if value_specs == "CACHED":
  102                             value_specs = (
  103                                 RESOURCE_SPECS.get("us-east-1")
  104                                 .get("ValueTypes")
  105                                 .get(value_type, {})
  106                             )
  107                         matches.extend(
  108                             cfn.check_value(
  109                                 p_value,
  110                                 prop,
  111                                 p_path,
  112                                 check_value=self.check_value,
  113                                 value_specs=value_specs,
  114                                 cfn=cfn,
  115                                 property_type=property_type,
  116                                 property_name=prop,
  117                             )
  118                         )
  119         return matches
  120 
  121     def match_resource_sub_properties(self, properties, property_type, path, cfn):
  122         """Match for sub properties"""
  123         matches = []
  124 
  125         specs = (
  126             RESOURCE_SPECS.get(cfn.regions[0])
  127             .get("PropertyTypes")
  128             .get(property_type, {})
  129             .get("Properties", {})
  130         )
  131         property_specs = (
  132             RESOURCE_SPECS.get(cfn.regions[0]).get("PropertyTypes").get(property_type)
  133         )
  134         matches.extend(self.check(cfn, properties, specs, property_specs, path))
  135 
  136         return matches
  137 
  138     def match_resource_properties(self, properties, resource_type, path, cfn):
  139         """Check CloudFormation Properties"""
  140         matches = []
  141 
  142         specs = (
  143             RESOURCE_SPECS.get(cfn.regions[0])
  144             .get("ResourceTypes")
  145             .get(resource_type, {})
  146             .get("Properties", {})
  147         )
  148         resource_specs = (
  149             RESOURCE_SPECS.get(cfn.regions[0]).get("ResourceTypes").get(resource_type)
  150         )
  151         matches.extend(self.check(cfn, properties, specs, resource_specs, path))
  152 
  153         return matches
  154
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: 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 @@
   
           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 @@
               .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 @@
               .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
  
verification_info: {"golden_diff": "diff --git a/src/cfnlint/rules/resources/properties/AllowedPattern.py b/src/cfnlint/rules/resources/properties/AllowedPattern.py\n--- a/src/cfnlint/rules/resources/properties/AllowedPattern.py\n+++ b/src/cfnlint/rules/resources/properties/AllowedPattern.py\n@@ -81,18 +81,16 @@\n \n         return matches\n \n-    def check(self, cfn, properties, value_specs, property_specs, path):\n+    def check(self, cfn, properties, property_specs, path):\n         \"\"\"Check itself\"\"\"\n         matches = []\n         for p_value, p_path in properties.items_safe(path[:]):\n             for prop in p_value:\n-                if prop in value_specs:\n-                    value = value_specs.get(prop).get(\"Value\", {})\n+                if prop in property_specs:\n+                    value = property_specs.get(prop).get(\"Value\", {})\n                     if value:\n                         value_type = value.get(\"ValueType\", \"\")\n-                        property_type = (\n-                            property_specs.get(\"Properties\").get(prop).get(\"Type\")\n-                        )\n+                        property_type = property_specs.get(prop).get(\"Type\")\n                         value_specs = (\n                             RESOURCE_SPECS.get(cfn.regions[0])\n                             .get(\"ValueTypes\")\n@@ -128,10 +126,7 @@\n             .get(property_type, {})\n             .get(\"Properties\", {})\n         )\n-        property_specs = (\n-            RESOURCE_SPECS.get(cfn.regions[0]).get(\"PropertyTypes\").get(property_type)\n-        )\n-        matches.extend(self.check(cfn, properties, specs, property_specs, path))\n+        matches.extend(self.check(cfn, properties, specs, path))\n \n         return matches\n \n@@ -145,9 +140,6 @@\n             .get(resource_type, {})\n             .get(\"Properties\", {})\n         )\n-        resource_specs = (\n-            RESOURCE_SPECS.get(cfn.regions[0]).get(\"ResourceTypes\").get(resource_type)\n-        )\n-        matches.extend(self.check(cfn, properties, specs, resource_specs, path))\n+        matches.extend(self.check(cfn, properties, specs, path))\n \n         return matches\n", "issue": "(AWS::Lambda::Function.FileSystemConfigs.LocalMountPath) `The local mount path must start with /mnt/ and be a valid absolute path.` not being checked\n### Is this feature request related to a new rule or cfn-lint capabilities?\n\nNew capability\n\n### Describe the feature you'd like to request\n\nThe following CFN template doesn't check the path for `LocalMountPath`:\r\n\r\n```yaml\r\nLambdaFunction:\r\n  Type: AWS::Lambda::Function\r\n  Properties:\r\n    FileSystemConfigs:\r\n      - Arn: <arn>\r\n        LocalMountPath: /efs\r\n```\r\n\r\nAccording to the Lambda GUI the path needs to start with `/mnt/`:\r\n\r\n```\r\nLocal mount path\r\nOnly absolute paths are supported.\r\nThe local mount path must start with /mnt/ and be a valid absolute path.\r\n```\n\n### Describe the solution you'd like\n\ncfn-lint should give you a notification if the path doesn't start with `/mnt/`:\r\n\r\n`The local mount path must start with /mnt/ and be a valid absolute path.`\n\n### Additional context\n\ncfn-lint v0.79.7\n\n### Is this something that you'd be interested in working on?\n\n- [ ] \ud83d\udc4b I may be able to implement this feature request\n\n### Would this feature include a breaking change?\n\n- [ ] \u26a0\ufe0f This feature might incur a breaking change\n", "before_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\nimport regex as re\n\nfrom cfnlint.helpers import RESOURCE_SPECS\nfrom cfnlint.rules import CloudFormationLintRule, RuleMatch\n\n\nclass AllowedPattern(CloudFormationLintRule):\n    \"\"\"Check if properties have a valid value\"\"\"\n\n    id = \"E3031\"\n    shortdesc = \"Check if property values adhere to a specific pattern\"\n    description = \"Check if properties have a valid value in case of a pattern (Regular Expression)\"\n    source_url = \"https://github.com/awslabs/cfn-python-lint/blob/main/docs/cfn-resource-specification.md#allowedpattern\"\n    tags = [\"resources\", \"property\", \"allowed pattern\", \"regex\"]\n\n    def __init__(self):\n        \"\"\"Init\"\"\"\n        super().__init__()\n        self.config_definition = {\n            \"exceptions\": {\n                \"default\": [],\n                \"type\": \"list\",\n                \"itemtype\": \"string\",\n            }\n        }\n        self.configure()\n\n    def initialize(self, cfn):\n        \"\"\"Initialize the rule\"\"\"\n        for resource_type_spec in RESOURCE_SPECS.get(cfn.regions[0]).get(\n            \"ResourceTypes\"\n        ):\n            self.resource_property_types.append(resource_type_spec)\n        for property_type_spec in RESOURCE_SPECS.get(cfn.regions[0]).get(\n            \"PropertyTypes\"\n        ):\n            self.resource_sub_property_types.append(property_type_spec)\n\n    def check_value(self, value, path, property_name, **kwargs):\n        \"\"\"Check Value\"\"\"\n        matches = []\n\n        # Get the Allowed Pattern Regex\n        value_pattern_regex = kwargs.get(\"value_specs\", {}).get(\n            \"AllowedPatternRegex\", {}\n        )\n        # Get the \"Human Readable\" version for the error message. Optional, if not specified,\n        # the RegEx itself is used.\n        value_pattern = kwargs.get(\"value_specs\", {}).get(\n            \"AllowedPattern\", value_pattern_regex\n        )\n\n        if isinstance(value, (int, float)):\n            value = str(value)\n\n        if isinstance(value, str):\n            if value_pattern_regex:\n                regex = re.compile(value_pattern_regex, re.ASCII)\n\n                # Ignore values with dynamic references. Simple check to prevent false-positives\n                # See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html\n                if \"{{resolve:\" not in value:\n                    if not regex.match(value):\n                        for exception in self.config.get(\"exceptions\"):\n                            exception_regex = re.compile(exception)\n                            if exception_regex.match(value):\n                                return matches\n                        full_path = \"/\".join(str(x) for x in path)\n\n                        message = \"{} contains invalid characters (Pattern: {}) at {}\"\n                        matches.append(\n                            RuleMatch(\n                                path,\n                                message.format(property_name, value_pattern, full_path),\n                            )\n                        )\n\n        return matches\n\n    def check(self, cfn, properties, value_specs, property_specs, path):\n        \"\"\"Check itself\"\"\"\n        matches = []\n        for p_value, p_path in properties.items_safe(path[:]):\n            for prop in p_value:\n                if prop in value_specs:\n                    value = value_specs.get(prop).get(\"Value\", {})\n                    if value:\n                        value_type = value.get(\"ValueType\", \"\")\n                        property_type = (\n                            property_specs.get(\"Properties\").get(prop).get(\"Type\")\n                        )\n                        value_specs = (\n                            RESOURCE_SPECS.get(cfn.regions[0])\n                            .get(\"ValueTypes\")\n                            .get(value_type, {})\n                        )\n                        if value_specs == \"CACHED\":\n                            value_specs = (\n                                RESOURCE_SPECS.get(\"us-east-1\")\n                                .get(\"ValueTypes\")\n                                .get(value_type, {})\n                            )\n                        matches.extend(\n                            cfn.check_value(\n                                p_value,\n                                prop,\n                                p_path,\n                                check_value=self.check_value,\n                                value_specs=value_specs,\n                                cfn=cfn,\n                                property_type=property_type,\n                                property_name=prop,\n                            )\n                        )\n        return matches\n\n    def match_resource_sub_properties(self, properties, property_type, path, cfn):\n        \"\"\"Match for sub properties\"\"\"\n        matches = []\n\n        specs = (\n            RESOURCE_SPECS.get(cfn.regions[0])\n            .get(\"PropertyTypes\")\n            .get(property_type, {})\n            .get(\"Properties\", {})\n        )\n        property_specs = (\n            RESOURCE_SPECS.get(cfn.regions[0]).get(\"PropertyTypes\").get(property_type)\n        )\n        matches.extend(self.check(cfn, properties, specs, property_specs, path))\n\n        return matches\n\n    def match_resource_properties(self, properties, resource_type, path, cfn):\n        \"\"\"Check CloudFormation Properties\"\"\"\n        matches = []\n\n        specs = (\n            RESOURCE_SPECS.get(cfn.regions[0])\n            .get(\"ResourceTypes\")\n            .get(resource_type, {})\n            .get(\"Properties\", {})\n        )\n        resource_specs = (\n            RESOURCE_SPECS.get(cfn.regions[0]).get(\"ResourceTypes\").get(resource_type)\n        )\n        matches.extend(self.check(cfn, properties, specs, resource_specs, path))\n\n        return matches\n", "path": "src/cfnlint/rules/resources/properties/AllowedPattern.py"}], "after_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\nimport regex as re\n\nfrom cfnlint.helpers import RESOURCE_SPECS\nfrom cfnlint.rules import CloudFormationLintRule, RuleMatch\n\n\nclass AllowedPattern(CloudFormationLintRule):\n    \"\"\"Check if properties have a valid value\"\"\"\n\n    id = \"E3031\"\n    shortdesc = \"Check if property values adhere to a specific pattern\"\n    description = \"Check if properties have a valid value in case of a pattern (Regular Expression)\"\n    source_url = \"https://github.com/awslabs/cfn-python-lint/blob/main/docs/cfn-resource-specification.md#allowedpattern\"\n    tags = [\"resources\", \"property\", \"allowed pattern\", \"regex\"]\n\n    def __init__(self):\n        \"\"\"Init\"\"\"\n        super().__init__()\n        self.config_definition = {\n            \"exceptions\": {\n                \"default\": [],\n                \"type\": \"list\",\n                \"itemtype\": \"string\",\n            }\n        }\n        self.configure()\n\n    def initialize(self, cfn):\n        \"\"\"Initialize the rule\"\"\"\n        for resource_type_spec in RESOURCE_SPECS.get(cfn.regions[0]).get(\n            \"ResourceTypes\"\n        ):\n            self.resource_property_types.append(resource_type_spec)\n        for property_type_spec in RESOURCE_SPECS.get(cfn.regions[0]).get(\n            \"PropertyTypes\"\n        ):\n            self.resource_sub_property_types.append(property_type_spec)\n\n    def check_value(self, value, path, property_name, **kwargs):\n        \"\"\"Check Value\"\"\"\n        matches = []\n\n        # Get the Allowed Pattern Regex\n        value_pattern_regex = kwargs.get(\"value_specs\", {}).get(\n            \"AllowedPatternRegex\", {}\n        )\n        # Get the \"Human Readable\" version for the error message. Optional, if not specified,\n        # the RegEx itself is used.\n        value_pattern = kwargs.get(\"value_specs\", {}).get(\n            \"AllowedPattern\", value_pattern_regex\n        )\n\n        if isinstance(value, (int, float)):\n            value = str(value)\n\n        if isinstance(value, str):\n            if value_pattern_regex:\n                regex = re.compile(value_pattern_regex, re.ASCII)\n\n                # Ignore values with dynamic references. Simple check to prevent false-positives\n                # See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html\n                if \"{{resolve:\" not in value:\n                    if not regex.match(value):\n                        for exception in self.config.get(\"exceptions\"):\n                            exception_regex = re.compile(exception)\n                            if exception_regex.match(value):\n                                return matches\n                        full_path = \"/\".join(str(x) for x in path)\n\n                        message = \"{} contains invalid characters (Pattern: {}) at {}\"\n                        matches.append(\n                            RuleMatch(\n                                path,\n                                message.format(property_name, value_pattern, full_path),\n                            )\n                        )\n\n        return matches\n\n    def check(self, cfn, properties, property_specs, path):\n        \"\"\"Check itself\"\"\"\n        matches = []\n        for p_value, p_path in properties.items_safe(path[:]):\n            for prop in p_value:\n                if prop in property_specs:\n                    value = property_specs.get(prop).get(\"Value\", {})\n                    if value:\n                        value_type = value.get(\"ValueType\", \"\")\n                        property_type = property_specs.get(prop).get(\"Type\")\n                        value_specs = (\n                            RESOURCE_SPECS.get(cfn.regions[0])\n                            .get(\"ValueTypes\")\n                            .get(value_type, {})\n                        )\n                        if value_specs == \"CACHED\":\n                            value_specs = (\n                                RESOURCE_SPECS.get(\"us-east-1\")\n                                .get(\"ValueTypes\")\n                                .get(value_type, {})\n                            )\n                        matches.extend(\n                            cfn.check_value(\n                                p_value,\n                                prop,\n                                p_path,\n                                check_value=self.check_value,\n                                value_specs=value_specs,\n                                cfn=cfn,\n                                property_type=property_type,\n                                property_name=prop,\n                            )\n                        )\n        return matches\n\n    def match_resource_sub_properties(self, properties, property_type, path, cfn):\n        \"\"\"Match for sub properties\"\"\"\n        matches = []\n\n        specs = (\n            RESOURCE_SPECS.get(cfn.regions[0])\n            .get(\"PropertyTypes\")\n            .get(property_type, {})\n            .get(\"Properties\", {})\n        )\n        matches.extend(self.check(cfn, properties, specs, path))\n\n        return matches\n\n    def match_resource_properties(self, properties, resource_type, path, cfn):\n        \"\"\"Check CloudFormation Properties\"\"\"\n        matches = []\n\n        specs = (\n            RESOURCE_SPECS.get(cfn.regions[0])\n            .get(\"ResourceTypes\")\n            .get(resource_type, {})\n            .get(\"Properties\", {})\n        )\n        matches.extend(self.check(cfn, properties, specs, path))\n\n        return matches\n", "path": "src/cfnlint/rules/resources/properties/AllowedPattern.py"}]}