What I want in step functions to do is my first step generates an output and in the next step I want that output to be inserted in a json and produced as the output.
For example :
Output for step 1 : HelloWorld
Input for step 2 : HelloWorld
Output for step 2 :
myData : {
data : HelloWorld
}
I have tried the following state machine, but it fails.
{
"Comment": "Sample State Machine",
"StartAt": "StartTask",
"States": {
"StartTask": {
"Type": "Pass",
"Result": "Hello World!",
"Next": "RefactorTask"
},
"RefactorTask": {
"Type": "Pass",
"Result" : {
"$" : "$"
},
"ResultPath" : "$.myData.data"
}
}
}
Error :
{
"error": "States.ReferencePathConflict",
"cause": "Unable to apply step \"myData\" to input \"Hello World!\""
}