AWS 步骤函数 - 转换 {AWS::AccountId}::StepFunctionsYamlTransform 失败,没有错误消息

AWS step functions - Transform {AWS::AccountId}::StepFunctionsYamlTransform failed without an error message

我正在编写用于创建 aws 步进函数statemachine 的 cloudformation 模板。以下是导致错误的模板部分

AWSTemplateFormatVersion: 2010-09-09
Transform:
- StepFunctionsYamlTransform

StepFunctionsStateMachine:
  Type: AWS::StepFunctions::StateMachine
  Properties:
    StateMachineName: MyStack
    RoleArn: !GetAtt StateMachineRole.Arn
    DefinitionStringYaml: !Sub
    - |
      Comment: My-Stack-workflow
      StartAt: LambdaToStart
      TimeoutSeconds: 43200
      States:
        LambdaToStart:
          Type: Task
          Resource: "${LambdaToStartArn}"
          Next: WaitToWriteInS3
        WaitToWriteInS3:
          Type: Wait
          Seconds: 5
          Next: Batch_Job_1
        Batch_Job_1:
          Type: Task
          Next: LambdaForTriggerEmrJob
          Resource: arn:aws:states:::batch:submitJob.sync
          Parameters:
            JobName: "${BatchJob1}"
            JobDefinition: "${BatchJob1DefinitionArn}"
            JobQueue: arn:aws:batch:${AWS::Region}:${AWS::AccountId}:job-queue/${QueueName}
        LambdaForTriggerEmrJob:
          Type: Task
          Resource: "${LambdaForEmrArn}"
          Next: WaitFoEmrState
        WaitFoEmrState:
          Type: Wait
          Seconds: 90
          Next: CheckEmrState
        CheckEmrState:
          Type: Task
          Resource: "${ClusterStateCheckArn}"
          InputPath: "$.input.cluster"  # Values coming from lambda
          ResultPath: "$.input.cluster"  # Values coming from lambda
          Retry: *LambdaRetryConfig
          Next: IsClusterRunning
        IsClusterRunning:
          Type: Choice
          Default: WaitFoEmrState
          Choices:
          - Variable: "$.input.cluster.state"
            StringEquals: FAILED
            Next: StateMachineFailure
          - Variable: "$.input.cluster.state" # Values coming from lambda
            StringEquals: SUCCEEDED
            Next: FinalBatchJob
        StateMachineFailure:
          Type: Fail
        FinalBatchJob:
          Type: Task
          Resource: arn:aws:states:::batch:submitJob.sync
          Parameters:
            JobName: "${FinalBatch}"
            JobDefinition: "${FinalBatchDefinitionArn}"
            JobQueue: arn:aws:batch:${AWS::Region}:${AWS::AccountId}:job-queue/${QueueName
          End: true
    - LambdaToStartArn: !GetAtt LambdaToStart.Arn
      LambdaForEmrArn: !GetAtt LambdaForEmr.Arn
      BatchJob1DefinitionArn: !Ref BatchJob1Definition
      FinalBatchDefinitionArn: !Ref FinalBatchDefinition
      BatchJob1: !Sub ${AWS::StackName}-batch-1
      FinalBatch: !Sub ${AWS::StackName}-final-batch
      ClusterStateCheckArn: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cluster-state

是returns下面的错误

Failed to create the changeset: Waiter ChangeSetCreateComplete failed:
Waiter encountered a terminal failure state Status: FAILED. Reason: 
Transform {AWS::AccountId}::StepFunctionsYamlTransform failed without an 
error message.

任何人都可以帮助识别此问题的解决方案吗?我无法调试很多,因为它在没有错误消息的情况下失败了。 TIA

AWS cloudformation 错误有时非常奇怪并且很难调试。但是我发现了错误。这是第 9 行 JobQueue: arn:aws:batch:${AWS::Region}:${AWS::AccountId}:job-queue/${QueueName,很容易看出我在最后错过了 }。所以这是一个语法错误