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.

preguntada hace un año331 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
EXPERTO
respondido hace un año
profile picture
EXPERTO
revisado hace un año
  • 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!

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