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

0

【以下的问题经过翻译处理】 ``` { "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而不是转换参数,有人可以帮忙吗。
谢谢
1 Answer
0

【以下的回答经过翻译处理】 获得了解决方案,实际上我需要像下面这样使用 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
    }
  }
}

profile picture
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions