We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Invalid Aliases when using SSM dynamic references
### CloudFormation Lint Version

0.83.0

### What operating system are you using?

Mac

### Describe the bug

When using a dynamic reference to resolve the Alias domain, cfn-lint fails indicating it's an invalid alias. Shouldn't the code check if this is a `REGEX_DYN_REF` in https://github.com/aws-cloudformation/cfn-lint/blob/main/src/cfnlint/rules/resources/cloudfront/Aliases.py and ignore if so?

A workaround would be to use "!Sub" which apparently is ignored already (`FUNCTIONS`). Shouldn't we also ignore when `REGEX_DYN_REF`?

### Expected behavior

E3013 shouldn't be informed, since there's no way to validate the dynamic-reference value from cfn-lint perspective (?)

### Reproduction template

```
CloudFront:
        Type: AWS::CloudFront::Distribution
        Properties:
            DistributionConfig:
                Enabled: true
                Aliases:
                    - "{{resolve:ssm:/env/fqdns/certifier}}"
                DefaultRootObject: index.html
``` 

--- 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/cloudfront/Aliases.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 FUNCTIONS
8 from cfnlint.rules import CloudFormationLintRule, RuleMatch
9 
10 
11 class Aliases(CloudFormationLintRule):
12     """Check if CloudFront Aliases are valid domain names"""
13 
14     id = "E3013"
15     shortdesc = "CloudFront Aliases"
16     description = "CloudFront aliases should contain valid domain names"
17     source_url = "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-aliases"
18     tags = ["properties", "cloudfront"]
19 
20     def match(self, cfn):
21         """Check cloudfront Resource Parameters"""
22 
23         matches = []
24 
25         valid_domain = re.compile(
26             r"^(?:[a-z0-9\*](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$"
27         )
28 
29         results = cfn.get_resource_properties(
30             ["AWS::CloudFront::Distribution", "DistributionConfig"]
31         )
32         for result in results:
33             aliases = result["Value"].get("Aliases")
34             if aliases:
35                 for alias in aliases:
36                     if isinstance(alias, str) and alias not in FUNCTIONS:
37                         wildcard = alias.split(".")
38                         if "*" in wildcard[1:]:
39                             path = result["Path"] + ["Aliases"]
40                             message = f'Invalid use of wildcards: {alias} at {"/".join(result["Path"])}'
41                             matches.append(RuleMatch(path, message))
42                         if not re.match(valid_domain, alias):
43                             path = result["Path"] + ["Aliases"]
44                             message = f'Invalid alias found: {alias} at {"/".join(result["Path"])}'
45                             matches.append(RuleMatch(path, message))
46 
47         return matches
48
```
--- 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/resources/cloudfront/Aliases.py b/src/cfnlint/rules/resources/cloudfront/Aliases.py
--- a/src/cfnlint/rules/resources/cloudfront/Aliases.py
+++ b/src/cfnlint/rules/resources/cloudfront/Aliases.py
@@ -4,7 +4,7 @@
 """
 import regex as re
 
-from cfnlint.helpers import FUNCTIONS
+from cfnlint.helpers import FUNCTIONS, REGEX_DYN_REF
 from cfnlint.rules import CloudFormationLintRule, RuleMatch
 
 
@@ -35,6 +35,8 @@
                 for alias in aliases:
                     if isinstance(alias, str) and alias not in FUNCTIONS:
                         wildcard = alias.split(".")
+                        if re.match(REGEX_DYN_REF, alias):
+                            continue
                         if "*" in wildcard[1:]:
                             path = result["Path"] + ["Aliases"]
                             message = f'Invalid use of wildcards: {alias} at {"/".join(result["Path"])}'

{"golden_diff": "diff --git a/src/cfnlint/rules/resources/cloudfront/Aliases.py b/src/cfnlint/rules/resources/cloudfront/Aliases.py\n--- a/src/cfnlint/rules/resources/cloudfront/Aliases.py\n+++ b/src/cfnlint/rules/resources/cloudfront/Aliases.py\n@@ -4,7 +4,7 @@\n \"\"\"\n import regex as re\n \n-from cfnlint.helpers import FUNCTIONS\n+from cfnlint.helpers import FUNCTIONS, REGEX_DYN_REF\n from cfnlint.rules import CloudFormationLintRule, RuleMatch\n \n \n@@ -35,6 +35,8 @@\n                 for alias in aliases:\n                     if isinstance(alias, str) and alias not in FUNCTIONS:\n                         wildcard = alias.split(\".\")\n+                        if re.match(REGEX_DYN_REF, alias):\n+                            continue\n                         if \"*\" in wildcard[1:]:\n                             path = result[\"Path\"] + [\"Aliases\"]\n                             message = f'Invalid use of wildcards: {alias} at {\"/\".join(result[\"Path\"])}'\n", "issue": "Invalid Aliases when using SSM dynamic references\n### CloudFormation Lint Version\r\n\r\n0.83.0\r\n\r\n### What operating system are you using?\r\n\r\nMac\r\n\r\n### Describe the bug\r\n\r\nWhen using a dynamic reference to resolve the Alias domain, cfn-lint fails indicating it's an invalid alias. Shouldn't the code check if this is a `REGEX_DYN_REF` in https://github.com/aws-cloudformation/cfn-lint/blob/main/src/cfnlint/rules/resources/cloudfront/Aliases.py and ignore if so?\r\n\r\nA workaround would be to use \"!Sub\" which apparently is ignored already (`FUNCTIONS`). Shouldn't we also ignore when `REGEX_DYN_REF`?\r\n\r\n### Expected behavior\r\n\r\nE3013 shouldn't be informed, since there's no way to validate the dynamic-reference value from cfn-lint perspective (?)\r\n\r\n### Reproduction template\r\n\r\n```\r\nCloudFront:\r\n        Type: AWS::CloudFront::Distribution\r\n        Properties:\r\n            DistributionConfig:\r\n                Enabled: true\r\n                Aliases:\r\n                    - \"{{resolve:ssm:/env/fqdns/certifier}}\"\r\n                DefaultRootObject: index.html\r\n``` \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 FUNCTIONS\nfrom cfnlint.rules import CloudFormationLintRule, RuleMatch\n\n\nclass Aliases(CloudFormationLintRule):\n    \"\"\"Check if CloudFront Aliases are valid domain names\"\"\"\n\n    id = \"E3013\"\n    shortdesc = \"CloudFront Aliases\"\n    description = \"CloudFront aliases should contain valid domain names\"\n    source_url = \"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-aliases\"\n    tags = [\"properties\", \"cloudfront\"]\n\n    def match(self, cfn):\n        \"\"\"Check cloudfront Resource Parameters\"\"\"\n\n        matches = []\n\n        valid_domain = re.compile(\n            r\"^(?:[a-z0-9\\*](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$\"\n        )\n\n        results = cfn.get_resource_properties(\n            [\"AWS::CloudFront::Distribution\", \"DistributionConfig\"]\n        )\n        for result in results:\n            aliases = result[\"Value\"].get(\"Aliases\")\n            if aliases:\n                for alias in aliases:\n                    if isinstance(alias, str) and alias not in FUNCTIONS:\n                        wildcard = alias.split(\".\")\n                        if \"*\" in wildcard[1:]:\n                            path = result[\"Path\"] + [\"Aliases\"]\n                            message = f'Invalid use of wildcards: {alias} at {\"/\".join(result[\"Path\"])}'\n                            matches.append(RuleMatch(path, message))\n                        if not re.match(valid_domain, alias):\n                            path = result[\"Path\"] + [\"Aliases\"]\n                            message = f'Invalid alias found: {alias} at {\"/\".join(result[\"Path\"])}'\n                            matches.append(RuleMatch(path, message))\n\n        return matches\n", "path": "src/cfnlint/rules/resources/cloudfront/Aliases.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 FUNCTIONS, REGEX_DYN_REF\nfrom cfnlint.rules import CloudFormationLintRule, RuleMatch\n\n\nclass Aliases(CloudFormationLintRule):\n    \"\"\"Check if CloudFront Aliases are valid domain names\"\"\"\n\n    id = \"E3013\"\n    shortdesc = \"CloudFront Aliases\"\n    description = \"CloudFront aliases should contain valid domain names\"\n    source_url = \"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-aliases\"\n    tags = [\"properties\", \"cloudfront\"]\n\n    def match(self, cfn):\n        \"\"\"Check cloudfront Resource Parameters\"\"\"\n\n        matches = []\n\n        valid_domain = re.compile(\n            r\"^(?:[a-z0-9\\*](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$\"\n        )\n\n        results = cfn.get_resource_properties(\n            [\"AWS::CloudFront::Distribution\", \"DistributionConfig\"]\n        )\n        for result in results:\n            aliases = result[\"Value\"].get(\"Aliases\")\n            if aliases:\n                for alias in aliases:\n                    if isinstance(alias, str) and alias not in FUNCTIONS:\n                        wildcard = alias.split(\".\")\n                        if re.match(REGEX_DYN_REF, alias):\n                            continue\n                        if \"*\" in wildcard[1:]:\n                            path = result[\"Path\"] + [\"Aliases\"]\n                            message = f'Invalid use of wildcards: {alias} at {\"/\".join(result[\"Path\"])}'\n                            matches.append(RuleMatch(path, message))\n                        if not re.match(valid_domain, alias):\n                            path = result[\"Path\"] + [\"Aliases\"]\n                            message = f'Invalid alias found: {alias} at {\"/\".join(result[\"Path\"])}'\n                            matches.append(RuleMatch(path, message))\n\n        return matches\n", "path": "src/cfnlint/rules/resources/cloudfront/Aliases.py"}]}