We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
E1017 with nested !Select
*cfn-lint version: (`cfn-lint --version`)*
0.46.0

*Description of issue.*
When linting this CFT YAML:
```yaml
subnet0A:
    DependsOn: ipv6CidrBlock
    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref vpc
      CidrBlock: !Select
        - !Select
          - 1
          - !Split
            - ','
            - !FindInMap
              - subnetMap
              - !Ref numAzs
              - !Ref numSubnets
        - 'Fn::Cidr':
            - !GetAtt
              - vpc
              - CidrBlock
            - !Select
              - 0
              - !Split
                - ','
                - !FindInMap
                  - subnetMap
                  - !Ref numAzs
                  - !Ref numSubnets
            - !FindInMap
              - subnetMap
              - maskTocidrBits
              - !Ref subnetMask
```

I get this error:

E1017 Select index should be an Integer or a function Ref or FindInMap for Resources/subnet0A/Properties/CidrBlock/Fn::Select

Template works fine.
thanks

Cfn-lint uses the [CloudFormation Resource Specifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) as the base to do validation. These files are included as part of the application version. Please update to the latest version of `cfn-lint` or update the spec files manually (`cfn-lint -u`)


--- 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/Select.py`
Content:
```
1 """
2 Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 SPDX-License-Identifier: MIT-0
4 """
5 import six
6 from cfnlint.rules import CloudFormationLintRule
7 from cfnlint.rules import RuleMatch
8 
9 
10 class Select(CloudFormationLintRule):
11     """Check if Select values are correct"""
12     id = 'E1017'
13     shortdesc = 'Select validation of parameters'
14     description = 'Making sure the function not is of list'
15     source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html'
16     tags = ['functions', 'select']
17 
18     def match(self, cfn):
19         matches = []
20 
21         select_objs = cfn.search_deep_keys('Fn::Select')
22 
23         supported_functions = [
24             'Fn::FindInMap',
25             'Fn::GetAtt',
26             'Fn::GetAZs',
27             'Fn::If',
28             'Fn::Split',
29             'Fn::Cidr',
30             'Ref'
31         ]
32 
33         for select_obj in select_objs:
34             select_value_obj = select_obj[-1]
35             tree = select_obj[:-1]
36             if isinstance(select_value_obj, list):
37                 if len(select_value_obj) == 2:
38                     index_obj = select_value_obj[0]
39                     list_of_objs = select_value_obj[1]
40                     if isinstance(index_obj, dict):
41                         if len(index_obj) == 1:
42                             for index_key, _ in index_obj.items():
43                                 if index_key not in ['Ref', 'Fn::FindInMap']:
44                                     message = 'Select index should be an Integer or a function Ref or FindInMap for {0}'
45                                     matches.append(RuleMatch(
46                                         tree, message.format('/'.join(map(str, tree)))))
47                     elif not isinstance(index_obj, six.integer_types):
48                         try:
49                             int(index_obj)
50                         except ValueError:
51                             message = 'Select index should be an Integer or a function of Ref or FindInMap for {0}'
52                             matches.append(RuleMatch(
53                                 tree, message.format('/'.join(map(str, tree)))))
54                     if isinstance(list_of_objs, dict):
55                         if len(list_of_objs) == 1:
56                             for key, _ in list_of_objs.items():
57                                 if key not in supported_functions:
58                                     message = 'Select should use a supported function of {0}'
59                                     matches.append(RuleMatch(
60                                         tree, message.format(', '.join(map(str, supported_functions)))))
61                         else:
62                             message = 'Select should use a supported function of {0}'
63                             matches.append(RuleMatch(
64                                 tree, message.format(', '.join(map(str, supported_functions)))))
65                     elif not isinstance(list_of_objs, list):
66                         message = 'Select should be an array of values for {0}'
67                         matches.append(RuleMatch(
68                             tree, message.format('/'.join(map(str, tree)))))
69                 else:
70                     message = 'Select should be a list of 2 elements for {0}'
71                     matches.append(RuleMatch(
72                         tree, message.format('/'.join(map(str, tree)))))
73             else:
74                 message = 'Select should be a list of 2 elements for {0}'
75                 matches.append(RuleMatch(
76                     tree, message.format('/'.join(map(str, tree)))))
77         return matches
78
```
--- 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/Select.py b/src/cfnlint/rules/functions/Select.py
--- a/src/cfnlint/rules/functions/Select.py
+++ b/src/cfnlint/rules/functions/Select.py
@@ -40,7 +40,7 @@
                     if isinstance(index_obj, dict):
                         if len(index_obj) == 1:
                             for index_key, _ in index_obj.items():
-                                if index_key not in ['Ref', 'Fn::FindInMap']:
+                                if index_key not in ['Ref', 'Fn::FindInMap', 'Fn::Select']:
                                     message = 'Select index should be an Integer or a function Ref or FindInMap for {0}'
                                     matches.append(RuleMatch(
                                         tree, message.format('/'.join(map(str, tree)))))

{"golden_diff": "diff --git a/src/cfnlint/rules/functions/Select.py b/src/cfnlint/rules/functions/Select.py\n--- a/src/cfnlint/rules/functions/Select.py\n+++ b/src/cfnlint/rules/functions/Select.py\n@@ -40,7 +40,7 @@\n                     if isinstance(index_obj, dict):\n                         if len(index_obj) == 1:\n                             for index_key, _ in index_obj.items():\n-                                if index_key not in ['Ref', 'Fn::FindInMap']:\n+                                if index_key not in ['Ref', 'Fn::FindInMap', 'Fn::Select']:\n                                     message = 'Select index should be an Integer or a function Ref or FindInMap for {0}'\n                                     matches.append(RuleMatch(\n                                         tree, message.format('/'.join(map(str, tree)))))\n", "issue": "E1017 with nested !Select\n*cfn-lint version: (`cfn-lint --version`)*\r\n0.46.0\r\n\r\n*Description of issue.*\r\nWhen linting this CFT YAML:\r\n```yaml\r\nsubnet0A:\r\n    DependsOn: ipv6CidrBlock\r\n    Type: 'AWS::EC2::Subnet'\r\n    Properties:\r\n      VpcId: !Ref vpc\r\n      CidrBlock: !Select\r\n        - !Select\r\n          - 1\r\n          - !Split\r\n            - ','\r\n            - !FindInMap\r\n              - subnetMap\r\n              - !Ref numAzs\r\n              - !Ref numSubnets\r\n        - 'Fn::Cidr':\r\n            - !GetAtt\r\n              - vpc\r\n              - CidrBlock\r\n            - !Select\r\n              - 0\r\n              - !Split\r\n                - ','\r\n                - !FindInMap\r\n                  - subnetMap\r\n                  - !Ref numAzs\r\n                  - !Ref numSubnets\r\n            - !FindInMap\r\n              - subnetMap\r\n              - maskTocidrBits\r\n              - !Ref subnetMask\r\n```\r\n\r\nI get this error:\r\n\r\nE1017 Select index should be an Integer or a function Ref or FindInMap for Resources/subnet0A/Properties/CidrBlock/Fn::Select\r\n\r\nTemplate works fine.\r\nthanks\r\n\r\nCfn-lint uses the [CloudFormation Resource Specifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) as the base to do validation. These files are included as part of the application version. Please update to the latest version of `cfn-lint` or update the spec files manually (`cfn-lint -u`)\r\n\n", "before_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\nimport six\nfrom cfnlint.rules import CloudFormationLintRule\nfrom cfnlint.rules import RuleMatch\n\n\nclass Select(CloudFormationLintRule):\n    \"\"\"Check if Select values are correct\"\"\"\n    id = 'E1017'\n    shortdesc = 'Select validation of parameters'\n    description = 'Making sure the function not is of list'\n    source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html'\n    tags = ['functions', 'select']\n\n    def match(self, cfn):\n        matches = []\n\n        select_objs = cfn.search_deep_keys('Fn::Select')\n\n        supported_functions = [\n            'Fn::FindInMap',\n            'Fn::GetAtt',\n            'Fn::GetAZs',\n            'Fn::If',\n            'Fn::Split',\n            'Fn::Cidr',\n            'Ref'\n        ]\n\n        for select_obj in select_objs:\n            select_value_obj = select_obj[-1]\n            tree = select_obj[:-1]\n            if isinstance(select_value_obj, list):\n                if len(select_value_obj) == 2:\n                    index_obj = select_value_obj[0]\n                    list_of_objs = select_value_obj[1]\n                    if isinstance(index_obj, dict):\n                        if len(index_obj) == 1:\n                            for index_key, _ in index_obj.items():\n                                if index_key not in ['Ref', 'Fn::FindInMap']:\n                                    message = 'Select index should be an Integer or a function Ref or FindInMap for {0}'\n                                    matches.append(RuleMatch(\n                                        tree, message.format('/'.join(map(str, tree)))))\n                    elif not isinstance(index_obj, six.integer_types):\n                        try:\n                            int(index_obj)\n                        except ValueError:\n                            message = 'Select index should be an Integer or a function of Ref or FindInMap for {0}'\n                            matches.append(RuleMatch(\n                                tree, message.format('/'.join(map(str, tree)))))\n                    if isinstance(list_of_objs, dict):\n                        if len(list_of_objs) == 1:\n                            for key, _ in list_of_objs.items():\n                                if key not in supported_functions:\n                                    message = 'Select should use a supported function of {0}'\n                                    matches.append(RuleMatch(\n                                        tree, message.format(', '.join(map(str, supported_functions)))))\n                        else:\n                            message = 'Select should use a supported function of {0}'\n                            matches.append(RuleMatch(\n                                tree, message.format(', '.join(map(str, supported_functions)))))\n                    elif not isinstance(list_of_objs, list):\n                        message = 'Select should be an array of values for {0}'\n                        matches.append(RuleMatch(\n                            tree, message.format('/'.join(map(str, tree)))))\n                else:\n                    message = 'Select should be a list of 2 elements for {0}'\n                    matches.append(RuleMatch(\n                        tree, message.format('/'.join(map(str, tree)))))\n            else:\n                message = 'Select should be a list of 2 elements for {0}'\n                matches.append(RuleMatch(\n                    tree, message.format('/'.join(map(str, tree)))))\n        return matches\n", "path": "src/cfnlint/rules/functions/Select.py"}], "after_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\nimport six\nfrom cfnlint.rules import CloudFormationLintRule\nfrom cfnlint.rules import RuleMatch\n\n\nclass Select(CloudFormationLintRule):\n    \"\"\"Check if Select values are correct\"\"\"\n    id = 'E1017'\n    shortdesc = 'Select validation of parameters'\n    description = 'Making sure the function not is of list'\n    source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html'\n    tags = ['functions', 'select']\n\n    def match(self, cfn):\n        matches = []\n\n        select_objs = cfn.search_deep_keys('Fn::Select')\n\n        supported_functions = [\n            'Fn::FindInMap',\n            'Fn::GetAtt',\n            'Fn::GetAZs',\n            'Fn::If',\n            'Fn::Split',\n            'Fn::Cidr',\n            'Ref'\n        ]\n\n        for select_obj in select_objs:\n            select_value_obj = select_obj[-1]\n            tree = select_obj[:-1]\n            if isinstance(select_value_obj, list):\n                if len(select_value_obj) == 2:\n                    index_obj = select_value_obj[0]\n                    list_of_objs = select_value_obj[1]\n                    if isinstance(index_obj, dict):\n                        if len(index_obj) == 1:\n                            for index_key, _ in index_obj.items():\n                                if index_key not in ['Ref', 'Fn::FindInMap', 'Fn::Select']:\n                                    message = 'Select index should be an Integer or a function Ref or FindInMap for {0}'\n                                    matches.append(RuleMatch(\n                                        tree, message.format('/'.join(map(str, tree)))))\n                    elif not isinstance(index_obj, six.integer_types):\n                        try:\n                            int(index_obj)\n                        except ValueError:\n                            message = 'Select index should be an Integer or a function of Ref or FindInMap for {0}'\n                            matches.append(RuleMatch(\n                                tree, message.format('/'.join(map(str, tree)))))\n                    if isinstance(list_of_objs, dict):\n                        if len(list_of_objs) == 1:\n                            for key, _ in list_of_objs.items():\n                                if key not in supported_functions:\n                                    message = 'Select should use a supported function of {0}'\n                                    matches.append(RuleMatch(\n                                        tree, message.format(', '.join(map(str, supported_functions)))))\n                        else:\n                            message = 'Select should use a supported function of {0}'\n                            matches.append(RuleMatch(\n                                tree, message.format(', '.join(map(str, supported_functions)))))\n                    elif not isinstance(list_of_objs, list):\n                        message = 'Select should be an array of values for {0}'\n                        matches.append(RuleMatch(\n                            tree, message.format('/'.join(map(str, tree)))))\n                else:\n                    message = 'Select should be a list of 2 elements for {0}'\n                    matches.append(RuleMatch(\n                        tree, message.format('/'.join(map(str, tree)))))\n            else:\n                message = 'Select should be a list of 2 elements for {0}'\n                matches.append(RuleMatch(\n                    tree, message.format('/'.join(map(str, tree)))))\n        return matches\n", "path": "src/cfnlint/rules/functions/Select.py"}]}