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. ?

posta 2 anni fa1726 visualizzazioni
1 Risposta
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
ESPERTO
Uri
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande