We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
IoT Topic Rule fails with E1029
*cfn-lint version: 0.22.4*

*Description of issue.*

When using AWS IoT substitution templates (in my case, for IoT SQL functions) within Cloud Formation, it is necessary to use the dollar sign and curly braces (For example `${topic()}`). This gets misinterpreted as a Fn::Sub Parameter which throws an E1029 error.

Please provide as much information as possible:
* Template linting issues:
  * Please provide a CloudFormation sample that generated the issue.
```yaml
  IotTopicRule: 
    Type: AWS::IoT::TopicRule
    Properties: 
      RuleName: IotTopicRule
      TopicRulePayload:
        RuleDisabled: false
        Sql: !Sub "SELECT * FROM 'some-topic'"
        Actions: 
          - 
            Kinesis: 
              RoleArn: !Sub '${topicRole.Arn}'
              StreamName: !Ref MyKinesisStream
              PartitionKey: "${topic()}" # error happens here
```
  * If present, please add links to the (official) documentation for clarification.

AWS IoT substitution templates are explained here: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html

How !Sub uses variables (which `cfn-lint` looks for) is found here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html#w2ab1c21c24c59b7

  * Validate if the issue still exists with the latest version of `cfn-lint` and/or the latest Spec files

Yes

--- 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/functions/SubNeeded.py`
Content:
```
1 """
2   Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 
4   Permission is hereby granted, free of charge, to any person obtaining a copy of this
5   software and associated documentation files (the "Software"), to deal in the Software
6   without restriction, including without limitation the rights to use, copy, modify,
7   merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8   permit persons to whom the Software is furnished to do so.
9 
10   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
11   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
12   PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
13   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
14   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 """
17 import re
18 from cfnlint import CloudFormationLintRule
19 from cfnlint import RuleMatch
20 
21 class SubNeeded(CloudFormationLintRule):
22     """Check if a substitution string exists without a substitution function"""
23     id = 'E1029'
24     shortdesc = 'Sub is required if a variable is used in a string'
25     description = 'If a substitution variable exists in a string but isn\'t wrapped with the Fn::Sub function the deployment will fail.'
26     source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html'
27     tags = ['functions', 'sub']
28 
29     # Free-form text properties to exclude from this rule
30     # content is part of AWS::CloudFormation::Init
31     excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition']
32     api_excludes = ['Uri', 'Body']
33 
34     # IAM Policy has special variables that don't require !Sub, Check for these
35     # https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html
36     # https://docs.aws.amazon.com/iot/latest/developerguide/basic-policy-variables.html
37     # https://docs.aws.amazon.com/iot/latest/developerguide/thing-policy-variables.html
38     # https://docs.aws.amazon.com/transfer/latest/userguide/users.html#users-policies-scope-down
39     resource_excludes = ['${aws:CurrentTime}', '${aws:EpochTime}', '${aws:TokenIssueTime}', '${aws:principaltype}',
40                          '${aws:SecureTransport}', '${aws:SourceIp}', '${aws:UserAgent}', '${aws:userid}',
41                          '${aws:username}', '${ec2:SourceInstanceARN}',
42                          '${iot:Connection.Thing.ThingName}', '${iot:Connection.Thing.ThingTypeName}',
43                          '${iot:Connection.Thing.IsAttached}', '${iot:ClientId}', '${transfer:HomeBucket}',
44                          '${transfer:HomeDirectory}', '${transfer:HomeFolder}', '${transfer:UserName}']
45 
46     def _match_values(self, searchRegex, cfnelem, path):
47         """Recursively search for values matching the searchRegex"""
48         values = []
49         if isinstance(cfnelem, dict):
50             for key in cfnelem:
51                 pathprop = path[:]
52                 pathprop.append(key)
53                 values.extend(self._match_values(searchRegex, cfnelem[key], pathprop))
54         elif isinstance(cfnelem, list):
55             for index, item in enumerate(cfnelem):
56                 pathprop = path[:]
57                 pathprop.append(index)
58                 values.extend(self._match_values(searchRegex, item, pathprop))
59         else:
60             # Leaf node
61             if isinstance(cfnelem, str) and re.match(searchRegex, cfnelem):
62                 # Get all variables as seperate paths
63                 regex = re.compile(r'(\$\{.*?\.?.*?})')
64                 for variable in re.findall(regex, cfnelem):
65                     values.append(path + [variable])
66 
67         return values
68 
69     def match_values(self, searchRegex, cfn):
70         """
71             Search for values in all parts of the templates that match the searchRegex
72         """
73         results = []
74         results.extend(self._match_values(searchRegex, cfn.template, []))
75         # Globals are removed during a transform.  They need to be checked manually
76         results.extend(self._match_values(searchRegex, cfn.template.get('Globals', {}), []))
77         return results
78 
79     def _api_exceptions(self, value):
80         """ Key value exceptions """
81         parameter_search = re.compile(r'^\$\{stageVariables\..*\}$')
82         return re.match(parameter_search, value)
83 
84     def match(self, cfn):
85         """Basic Rule Matching"""
86 
87         matches = []
88 
89         # Generic regex to match a string containing at least one ${parameter}
90         parameter_search = re.compile(r'^.*(\$\{.*\}.*(\$\{.*\}.*)*)$')
91 
92         # Get a list of paths to every leaf node string containing at least one ${parameter}
93         parameter_string_paths = self.match_values(parameter_search, cfn)
94 
95         # We want to search all of the paths to check if each one contains an 'Fn::Sub'
96         for parameter_string_path in parameter_string_paths:
97 
98             # Exxclude the special IAM variables
99             variable = parameter_string_path[-1]
100 
101             if 'Resource' in parameter_string_path:
102                 if variable in self.resource_excludes:
103                     continue
104 
105             # Exclude literals (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html)
106             if variable.startswith('${!'):
107                 continue
108 
109             found_sub = False
110             # Does the path contain an 'Fn::Sub'?
111             for step in parameter_string_path:
112                 if step in self.api_excludes:
113                     if self._api_exceptions(parameter_string_path[-1]):
114                         found_sub = True
115                 elif step == 'Fn::Sub' or step in self.excludes:
116                     found_sub = True
117 
118             # If we didn't find an 'Fn::Sub' it means a string containing a ${parameter} may not be evaluated correctly
119             if not found_sub:
120                 # Remove the last item (the variable) to prevent multiple errors on 1 line errors
121                 path = parameter_string_path[:-1]
122                 message = 'Found an embedded parameter outside of an "Fn::Sub" at {}'.format('/'.join(map(str, path)))
123                 matches.append(RuleMatch(path, message))
124 
125         return matches
126
```
--- 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()

```

diff --git a/src/cfnlint/rules/functions/SubNeeded.py b/src/cfnlint/rules/functions/SubNeeded.py
--- a/src/cfnlint/rules/functions/SubNeeded.py
+++ b/src/cfnlint/rules/functions/SubNeeded.py
@@ -28,7 +28,7 @@
 
     # Free-form text properties to exclude from this rule
     # content is part of AWS::CloudFormation::Init
-    excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition']
+    excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition', 'TopicRulePayload']
     api_excludes = ['Uri', 'Body']
 
     # IAM Policy has special variables that don't require !Sub, Check for these

{"golden_diff": "diff --git a/src/cfnlint/rules/functions/SubNeeded.py b/src/cfnlint/rules/functions/SubNeeded.py\n--- a/src/cfnlint/rules/functions/SubNeeded.py\n+++ b/src/cfnlint/rules/functions/SubNeeded.py\n@@ -28,7 +28,7 @@\n \n     # Free-form text properties to exclude from this rule\n     # content is part of AWS::CloudFormation::Init\n-    excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition']\n+    excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition', 'TopicRulePayload']\n     api_excludes = ['Uri', 'Body']\n \n     # IAM Policy has special variables that don't require !Sub, Check for these\n", "issue": "IoT Topic Rule fails with E1029\n*cfn-lint version: 0.22.4*\r\n\r\n*Description of issue.*\r\n\r\nWhen using AWS IoT substitution templates (in my case, for IoT SQL functions) within Cloud Formation, it is necessary to use the dollar sign and curly braces (For example `${topic()}`). This gets misinterpreted as a Fn::Sub Parameter which throws an E1029 error.\r\n\r\nPlease provide as much information as possible:\r\n* Template linting issues:\r\n  * Please provide a CloudFormation sample that generated the issue.\r\n```yaml\r\n  IotTopicRule: \r\n    Type: AWS::IoT::TopicRule\r\n    Properties: \r\n      RuleName: IotTopicRule\r\n      TopicRulePayload:\r\n        RuleDisabled: false\r\n        Sql: !Sub \"SELECT * FROM 'some-topic'\"\r\n        Actions: \r\n          - \r\n            Kinesis: \r\n              RoleArn: !Sub '${topicRole.Arn}'\r\n              StreamName: !Ref MyKinesisStream\r\n              PartitionKey: \"${topic()}\" # error happens here\r\n```\r\n  * If present, please add links to the (official) documentation for clarification.\r\n\r\nAWS IoT substitution templates are explained here: https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html\r\n\r\nHow !Sub uses variables (which `cfn-lint` looks for) is found here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html#w2ab1c21c24c59b7\r\n\r\n  * Validate if the issue still exists with the latest version of `cfn-lint` and/or the latest Spec files\r\n\r\nYes\n", "before_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport re\nfrom cfnlint import CloudFormationLintRule\nfrom cfnlint import RuleMatch\n\nclass SubNeeded(CloudFormationLintRule):\n    \"\"\"Check if a substitution string exists without a substitution function\"\"\"\n    id = 'E1029'\n    shortdesc = 'Sub is required if a variable is used in a string'\n    description = 'If a substitution variable exists in a string but isn\\'t wrapped with the Fn::Sub function the deployment will fail.'\n    source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html'\n    tags = ['functions', 'sub']\n\n    # Free-form text properties to exclude from this rule\n    # content is part of AWS::CloudFormation::Init\n    excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition']\n    api_excludes = ['Uri', 'Body']\n\n    # IAM Policy has special variables that don't require !Sub, Check for these\n    # https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html\n    # https://docs.aws.amazon.com/iot/latest/developerguide/basic-policy-variables.html\n    # https://docs.aws.amazon.com/iot/latest/developerguide/thing-policy-variables.html\n    # https://docs.aws.amazon.com/transfer/latest/userguide/users.html#users-policies-scope-down\n    resource_excludes = ['${aws:CurrentTime}', '${aws:EpochTime}', '${aws:TokenIssueTime}', '${aws:principaltype}',\n                         '${aws:SecureTransport}', '${aws:SourceIp}', '${aws:UserAgent}', '${aws:userid}',\n                         '${aws:username}', '${ec2:SourceInstanceARN}',\n                         '${iot:Connection.Thing.ThingName}', '${iot:Connection.Thing.ThingTypeName}',\n                         '${iot:Connection.Thing.IsAttached}', '${iot:ClientId}', '${transfer:HomeBucket}',\n                         '${transfer:HomeDirectory}', '${transfer:HomeFolder}', '${transfer:UserName}']\n\n    def _match_values(self, searchRegex, cfnelem, path):\n        \"\"\"Recursively search for values matching the searchRegex\"\"\"\n        values = []\n        if isinstance(cfnelem, dict):\n            for key in cfnelem:\n                pathprop = path[:]\n                pathprop.append(key)\n                values.extend(self._match_values(searchRegex, cfnelem[key], pathprop))\n        elif isinstance(cfnelem, list):\n            for index, item in enumerate(cfnelem):\n                pathprop = path[:]\n                pathprop.append(index)\n                values.extend(self._match_values(searchRegex, item, pathprop))\n        else:\n            # Leaf node\n            if isinstance(cfnelem, str) and re.match(searchRegex, cfnelem):\n                # Get all variables as seperate paths\n                regex = re.compile(r'(\\$\\{.*?\\.?.*?})')\n                for variable in re.findall(regex, cfnelem):\n                    values.append(path + [variable])\n\n        return values\n\n    def match_values(self, searchRegex, cfn):\n        \"\"\"\n            Search for values in all parts of the templates that match the searchRegex\n        \"\"\"\n        results = []\n        results.extend(self._match_values(searchRegex, cfn.template, []))\n        # Globals are removed during a transform.  They need to be checked manually\n        results.extend(self._match_values(searchRegex, cfn.template.get('Globals', {}), []))\n        return results\n\n    def _api_exceptions(self, value):\n        \"\"\" Key value exceptions \"\"\"\n        parameter_search = re.compile(r'^\\$\\{stageVariables\\..*\\}$')\n        return re.match(parameter_search, value)\n\n    def match(self, cfn):\n        \"\"\"Basic Rule Matching\"\"\"\n\n        matches = []\n\n        # Generic regex to match a string containing at least one ${parameter}\n        parameter_search = re.compile(r'^.*(\\$\\{.*\\}.*(\\$\\{.*\\}.*)*)$')\n\n        # Get a list of paths to every leaf node string containing at least one ${parameter}\n        parameter_string_paths = self.match_values(parameter_search, cfn)\n\n        # We want to search all of the paths to check if each one contains an 'Fn::Sub'\n        for parameter_string_path in parameter_string_paths:\n\n            # Exxclude the special IAM variables\n            variable = parameter_string_path[-1]\n\n            if 'Resource' in parameter_string_path:\n                if variable in self.resource_excludes:\n                    continue\n\n            # Exclude literals (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html)\n            if variable.startswith('${!'):\n                continue\n\n            found_sub = False\n            # Does the path contain an 'Fn::Sub'?\n            for step in parameter_string_path:\n                if step in self.api_excludes:\n                    if self._api_exceptions(parameter_string_path[-1]):\n                        found_sub = True\n                elif step == 'Fn::Sub' or step in self.excludes:\n                    found_sub = True\n\n            # If we didn't find an 'Fn::Sub' it means a string containing a ${parameter} may not be evaluated correctly\n            if not found_sub:\n                # Remove the last item (the variable) to prevent multiple errors on 1 line errors\n                path = parameter_string_path[:-1]\n                message = 'Found an embedded parameter outside of an \"Fn::Sub\" at {}'.format('/'.join(map(str, path)))\n                matches.append(RuleMatch(path, message))\n\n        return matches\n", "path": "src/cfnlint/rules/functions/SubNeeded.py"}], "after_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport re\nfrom cfnlint import CloudFormationLintRule\nfrom cfnlint import RuleMatch\n\nclass SubNeeded(CloudFormationLintRule):\n    \"\"\"Check if a substitution string exists without a substitution function\"\"\"\n    id = 'E1029'\n    shortdesc = 'Sub is required if a variable is used in a string'\n    description = 'If a substitution variable exists in a string but isn\\'t wrapped with the Fn::Sub function the deployment will fail.'\n    source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html'\n    tags = ['functions', 'sub']\n\n    # Free-form text properties to exclude from this rule\n    # content is part of AWS::CloudFormation::Init\n    excludes = ['UserData', 'ZipFile', 'Condition', 'AWS::CloudFormation::Init', 'CloudWatchAlarmDefinition', 'TopicRulePayload']\n    api_excludes = ['Uri', 'Body']\n\n    # IAM Policy has special variables that don't require !Sub, Check for these\n    # https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html\n    # https://docs.aws.amazon.com/iot/latest/developerguide/basic-policy-variables.html\n    # https://docs.aws.amazon.com/iot/latest/developerguide/thing-policy-variables.html\n    # https://docs.aws.amazon.com/transfer/latest/userguide/users.html#users-policies-scope-down\n    resource_excludes = ['${aws:CurrentTime}', '${aws:EpochTime}', '${aws:TokenIssueTime}', '${aws:principaltype}',\n                         '${aws:SecureTransport}', '${aws:SourceIp}', '${aws:UserAgent}', '${aws:userid}',\n                         '${aws:username}', '${ec2:SourceInstanceARN}',\n                         '${iot:Connection.Thing.ThingName}', '${iot:Connection.Thing.ThingTypeName}',\n                         '${iot:Connection.Thing.IsAttached}', '${iot:ClientId}', '${transfer:HomeBucket}',\n                         '${transfer:HomeDirectory}', '${transfer:HomeFolder}', '${transfer:UserName}']\n\n    def _match_values(self, searchRegex, cfnelem, path):\n        \"\"\"Recursively search for values matching the searchRegex\"\"\"\n        values = []\n        if isinstance(cfnelem, dict):\n            for key in cfnelem:\n                pathprop = path[:]\n                pathprop.append(key)\n                values.extend(self._match_values(searchRegex, cfnelem[key], pathprop))\n        elif isinstance(cfnelem, list):\n            for index, item in enumerate(cfnelem):\n                pathprop = path[:]\n                pathprop.append(index)\n                values.extend(self._match_values(searchRegex, item, pathprop))\n        else:\n            # Leaf node\n            if isinstance(cfnelem, str) and re.match(searchRegex, cfnelem):\n                # Get all variables as seperate paths\n                regex = re.compile(r'(\\$\\{.*?\\.?.*?})')\n                for variable in re.findall(regex, cfnelem):\n                    values.append(path + [variable])\n\n        return values\n\n    def match_values(self, searchRegex, cfn):\n        \"\"\"\n            Search for values in all parts of the templates that match the searchRegex\n        \"\"\"\n        results = []\n        results.extend(self._match_values(searchRegex, cfn.template, []))\n        # Globals are removed during a transform.  They need to be checked manually\n        results.extend(self._match_values(searchRegex, cfn.template.get('Globals', {}), []))\n        return results\n\n    def _api_exceptions(self, value):\n        \"\"\" Key value exceptions \"\"\"\n        parameter_search = re.compile(r'^\\$\\{stageVariables\\..*\\}$')\n        return re.match(parameter_search, value)\n\n    def match(self, cfn):\n        \"\"\"Basic Rule Matching\"\"\"\n\n        matches = []\n\n        # Generic regex to match a string containing at least one ${parameter}\n        parameter_search = re.compile(r'^.*(\\$\\{.*\\}.*(\\$\\{.*\\}.*)*)$')\n\n        # Get a list of paths to every leaf node string containing at least one ${parameter}\n        parameter_string_paths = self.match_values(parameter_search, cfn)\n\n        # We want to search all of the paths to check if each one contains an 'Fn::Sub'\n        for parameter_string_path in parameter_string_paths:\n\n            # Exxclude the special IAM variables\n            variable = parameter_string_path[-1]\n\n            if 'Resource' in parameter_string_path:\n                if variable in self.resource_excludes:\n                    continue\n\n            # Exclude literals (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html)\n            if variable.startswith('${!'):\n                continue\n\n            found_sub = False\n            # Does the path contain an 'Fn::Sub'?\n            for step in parameter_string_path:\n                if step in self.api_excludes:\n                    if self._api_exceptions(parameter_string_path[-1]):\n                        found_sub = True\n                elif step == 'Fn::Sub' or step in self.excludes:\n                    found_sub = True\n\n            # If we didn't find an 'Fn::Sub' it means a string containing a ${parameter} may not be evaluated correctly\n            if not found_sub:\n                # Remove the last item (the variable) to prevent multiple errors on 1 line errors\n                path = parameter_string_path[:-1]\n                message = 'Found an embedded parameter outside of an \"Fn::Sub\" at {}'.format('/'.join(map(str, path)))\n                matches.append(RuleMatch(path, message))\n\n        return matches\n", "path": "src/cfnlint/rules/functions/SubNeeded.py"}]}