EventBridge pipe transformer not working for arrays

0

I'm trying to set up a simple transformer for an EventBridge pipe that connects a SQS queue to a Step Functions workflow. The SQS queue receives input in the form

[  
  {  
    "key1": "value1",  
    "key2": "value2"  
  }  
]

The workflow expects a similar format but different key identifiers:

[  
  {  
    "workflowKey1": "value1",  
    "workflowKey2": "value2"  
  }  
]

The workflow can also be invoked from other sources so changing the expected input is not easily possible. Clicking on the fields I want to extract in AWS console suggests the following transformer, which unfortunately only extracts empty strings:

{
  "workflowKey1": <$.0.key1>,
  "workflowKey2": <$.0.key2>
}

Is there something wrong with my transformer, or is this an issue with EventBridge pipe itself?

已提問 9 個月前檢視次數 576 次
1 個回答
0

Hi, I believe that <$.0.key1> should be turned to <$.[0].key1> to indicate indice 0 of the surrounding array. Best, Didier

profile pictureAWS
專家
已回答 9 個月前
  • I tried that but it gives me a Transformer is invalid: Invalid syntax error. Same when I try <$[0].key1>

  • I have the same issue. I cannot find a good way to perform this. Is there any good documentation about the transformation package?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南