AWS step function giving error, when I had included the "Parameter" tag

0

I am trying to run the below step function code. It gives the error as "An error occurred while executing the state 'MyTestState' (entered at the event id #2). Invalid path '$.testonly' : No results for path: $['testonly']"

My Input:

 {
      "testonly":"srin"
   }

Step function definition Code:

{
  "Comment":"Testing the Step function",
  "StartAt":"MyTestState",
  "States": {
    "MyTestState": {
      "Type":"Pass",
       "Parameters": {
       "key1":"value1"
      },
      "OutputPath":"$.testonly",
      "Next":"SecondState"
     },
    "SecondState": {
      "Type":"Pass",
       "End":true
    }
  }
}

But if i remove the Parameters tag in the above code, it is giving me the right output as "srin".Not sure, why I am getting this issue with "Parameters" tag. Can you please let me know, if am missing anything here. ?

preguntada hace 2 años1726 visualizaciones
1 Respuesta
0

As this is a Pass state, the result of the state is what you defined in the Parameters attribute. In your case it only includes "key1". OutputPath is used to filter the output, i.e., to define what from the output will be sent to the next state. As the output does not include the "testonly" attribute, you are getting the error.

What exactly are you trying to do?

profile pictureAWS
EXPERTO
Uri
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas