将参数传递给下一步函数任务

Pass parameters to next step function task

{
  "Comment": "A description of my state machine",
  "StartAt": "Batch SubmitJob",
  "States": {
    "Batch SubmitJob": {
      "Type": "Task",
      "Resource": "arn:aws:states:::batch:submitJob.sync",
      "Parameters": {
        "JobDefinition": "arn:aws:batch:us-east-1:XXXXXXXXXXX:job-definition/clientcopyjobdef:1",
        "JobQueue": "arn:aws:batch:us-east-1:XXXXXXXXXX:job-queue/copyclientjq",
        "ContainerOverrides": {
          "Command.$": [
            "dotnet",
            "CopyClientJob.dll",
            "$.input"
          ]
        },
        "JobName.$": "$.input"
      },
      "End": true
    }
  }
}

我试图创建这个状态机,如果我直接将命令传递给 JobDefinition 它工作正常,但在这里我试图覆盖命令并想从状态输入传递命令参数,所以试图传递像上面的代码。对于 "JobName.$": "$.input" 它有效,但对于

"Command.$": [
            "dotnet",
            "CopyClientJob.dll",
            "$.input"
          ] 

它不工作,命令按原样传递给 aws batch 而不转换参数,有人可以帮助解决这个问题。 谢谢

得到解决方案,实际上我需要使用 States.Array 组合所有 3 个,如下所示

{
  "Comment": "A description of my state machine",
  "StartAt": "Batch SubmitJob",
  "States": {
    "Batch SubmitJob": {
      "Type": "Task",
      "Resource": "arn:aws:states:::batch:submitJob.sync",
      "Parameters": {
        "JobDefinition": "arn:aws:batch:us-east-1:XXXXXXXXX:job-definition/clientcopyjobdef:1",
        "JobQueue": "arn:aws:batch:us-east-1:XXXXXXXX:job-queue/copyclientjq",
        "ContainerOverrides": {
          "Command.$": "States.Array('dotnet', 'CopyClientJob.dll', $.input)"
        },
        "JobName": "test"
      },
      "End": true
    }
  }
}