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

feita há 2 anos1726 visualizações
1 Resposta
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
ESPECIALISTA
Uri
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas