Pass parameters to next step function task

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
    }
  }
}

I was trying to create this state machine, it was working fine if I am passing command to JobDefinition directly, but here I am truing to override the command and want to pass command parameter from state input, so trying to pass like above code. For "JobName.$": "$.input" it is working but for

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

It is not working, the command is passing as it is to aws batch without trasforming the parameter, can someone help on this. Thanks

2개 답변
0
수락된 답변

Got the solution, Actually I need to combine the all 3 using States.Array like below

{
  "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
    }
  }
}
AWS
답변함 2년 전
profile picture
전문가
검토됨 16일 전
0

Maybe try Command.$

profile pictureAWS
전문가
Uri
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠