Proper syntax to start-execution with Step Functions in AWS CLI

0

IS there any syntax documentation for how to run Step Functions with AWS CLI, and specifically for how to start an execution.

I input the ARN, and the json input but keep getting an error that the --input argument is only expecting one argument. I was hoping someone could provide an example of the proper syntax for these parameters.

Thanks!

2개 답변
1

Hello,

The correct syntax looks like this:

AWS stepfunctions start-execution --state-machine-arn $ARN  --input "{\"first_name\" : \"test\"}"  

I agree with you that the documentation is misleading/confusing because "input": "{\"first_name\" : \"test\"}" is not a valid JSON.

If your having issues with JSON encoding, jq can help, for example:

AWS stepfunctions start-execution --state-machine-arn $ARN --input "$(echo '{"my_key": "my_value"}' | jq -R . )" 

You can also read the input from a file:

aws stepfunctions start-execution --state-machine-arn $ARN --input "$(jq -R . input.json --raw-output)"

I hope this helps!

Regards,

Carl Östrand

profile picture
답변함 2년 전
-1

Hello, Attaching the link necessary for the same. Please refer the same to check for the syntax and the right options . [1]

Hope this helps !!

Link- https://awscli.amazonaws.com/v2/documentation/api/latest/reference/stepfunctions/start-execution.html -- [1]

profile pictureAWS
지원 엔지니어
답변함 2년 전
profile pictureAWS
전문가
Uri
검토됨 2년 전

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

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

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

관련 콘텐츠