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.

demandé il y a un an331 vues
1 réponse
0
Réponse acceptée

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
EXPERT
répondu il y a un an
profile picture
EXPERT
vérifié il y a un an
  • 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!

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions