Repository: aws-cloudformation/cfn-lint

Issue:
Crash when processing !GetAtt within Fn::ForEach
### CloudFormation Lint Version

0.79.6

### What operating system are you using?

Amazon Linux 2023

### Describe the bug

`cfn-lint` crashes with the following stack trace. The issue appears to be caused by the following section of the template.
```yaml
          ResourceId: !Sub
            - service/${Cluster}/${ServiceName}
            - ServiceName: !GetAtt
                - !Sub ${Identifier}Service
                - Name
```

```
Traceback (most recent call last):
  File "/home/testuser/.pyenv/versions/3.10.11/bin/cfn-lint", line 8, in <module>
    sys.exit(main())
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/__main__.py", line 39, in main
    matches = list(cfnlint.core.get_matches(filenames, args))
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/core.py", line 173, in get_matches
    matches = run_cli(
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/core.py", line 78, in run_cli
    return run_checks(filename, template, rules, regions, mandatory_rules)
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/core.py", line 345, in run_checks
    errors.extend(runner.transform())
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/runner.py", line 34, in transform
    matches = self.cfn.transform()
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/template/template.py", line 81, in transform
    return transform.transform(self)
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/template/transforms/transform.py", line 52, in transform
    cfn.graph = Graph(cfn)
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/graph.py", line 91, in __init__
    self._add_getatts(cfn)
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/graph.py", line 188, in _add_getatts
    and (self._is_resource(cfn, value[0]))
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/graph.py", line 263, in _is_resource
    return cfn.template.get("Resources", {}).get(identifier, {})
  File "/home/testuser/.pyenv/versions/3.10.11/lib/python3.10/site-packages/cfnlint/decode/node.py", line 108, in get
    return super().get(key, default)
TypeError: unhashable type: 'dict_node'
```

### Expected behavior

The template deploys as expected via CloudFormation, so I expect `cfn-lint` to be ok with this template also.

### Reproduction template

```yaml
AWSTemplateFormatVersion: "2010-09-09"

Transform: AWS::LanguageExtensions

Parameters:
  Cluster:
    Type: String

Resources:
  Fn::ForEach::Microservices:
    - Identifier
    - - ExampleService
    - ${Identifier}Service:
        Type: AWS::ECS::Service
        Properties:
          Cluster: !Ref Cluster
          DesiredCount: 1
          TaskDefinition: !Ref
            Fn::Sub: ${Identifier}Task
          SchedulingStrategy: REPLICA

      ${Identifier}Task:
        Type: AWS::ECS::TaskDefinition
        Properties:
          ContainerDefinitions:
            - Name: !Ref Identifier
              Image: httpd
              MemoryReservation: 1024

      ${Identifier}ScalableTarget:
        Type: AWS::ApplicationAutoScaling::ScalableTarget
        Properties:
          ResourceId: !Sub
            - service/${Cluster}/${ServiceName}
            - ServiceName: !GetAtt
                - !Sub ${Identifier}Service
                - Name
          MinCapacity: 1
          MaxCapacity: 2
          ServiceNamespace: ecs
          ScalableDimension: ecs:service:DesiredCount
          RoleARN: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService
```


Discussion:

Resolving patch:
diff --git a/src/cfnlint/template/transforms/_language_extensions.py b/src/cfnlint/template/transforms/_language_extensions.py
--- a/src/cfnlint/template/transforms/_language_extensions.py
+++ b/src/cfnlint/template/transforms/_language_extensions.py
@@ -150,6 +150,8 @@ def _walk(self, item: Any, params: MutableMapping[str, Any], cfn: Any):
                         )
                         if only_string:
                             return obj[k][0]
+                        if len(v) == 2:
+                            obj[k][1] = self._walk(v[1], params, cfn)
                 elif k == "Fn::FindInMap":
                     try:
                         mapping = _ForEachValueFnFindInMap(get_hash(v), v)
diff --git a/src/cfnlint/template/transforms/transform.py b/src/cfnlint/template/transforms/transform.py
--- a/src/cfnlint/template/transforms/transform.py
+++ b/src/cfnlint/template/transforms/transform.py
@@ -49,7 +49,7 @@ def transform(self, cfn: Any):
                 return matches
             cfn.template = template
 
+        LOGGER.info("Transformed template: %s", cfn.template)
         cfn.graph = Graph(cfn)
         cfn.conditions = Conditions(cfn)
-        LOGGER.info("Transformed template: %s", cfn.template)
         return matches


Test patch: