AWS Step Functions - Invalid JSON Path

0

I am getting the following error when attempting to use the following JSON Path in my ResultsSelector $.Clusters[:].ClusterIdentifier.

Enter image description here

What is curious to me is that in the Step Function Data Flow simulator, the results work as expected when testing the path selection, so I am at a loss as to how to proceed.

In the end, I want to use Describe Clusters to get the data on what is running and inspect the created array to determine if my cluster of interest is running.

feita há um ano331 visualizações
1 Resposta
0
Resposta aceita

Hi,

AWS Step Functions uses Amazon States Language to describe state machines declaratively, and the "@", ",", ":", and "?" operators are not supported, since all reference Paths MUST be unambiguous references to a single value, array, or object (subtree).

Thus, the wildcard symbol could be employed to select all elements of an object or array.

Step Function definition

{
  "Comment": "A description of my state machine",
  "StartAt": "Pass",
  "States": {
    "Pass": {
      "Type": "Pass",
      "End": true,
      "Parameters": {
        "clusterids.$": "$.Clusters[*].ClusterIdentifier"
      }
    }
  }
}

Input

{
  "Clusters": [
    {
      "ClusterIdentifier": 1
    },
    {
      "ClusterIdentifier": 2
    }
  ]
}

Output

{
  "clusterids": [
    1,
    2
  ]
}

I hope this helps you.

profile picture
ESPECIALISTA
respondido há um ano
profile picture
ESPECIALISTA
avaliado há um ano
  • Ahh, I even scanned the spec and totally didn't pick up on that, especially since data were returned in the data flow simulator. Regardless, thank you for the note!

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