amazon-web-servicesaws-event-bridge

AWS EventBridge InputPath for target is invalid


I'm configuring a AWS EventBridge input transformer to extract 10.193.133.18 from the following event:

{
  "detail":{
    "attachments":[
      {
        "type":"serviceconnectdetail",
        "details":[
          {
            "name":"ContainerName",
            "value":"ecs-service-connect-1dmFs"
          }
        ]
      },
      {
        "type":"eni",
        "details":[
          {
            "name":"privateIPv4Address",
            "value":"10.193.133.18"
          }
        ]
      }
    ]
  }
}

Input path:

{
  "privateIp": "$.detail.attachments[?(@.type == 'eni')].details[?(@.name == 'privateIPv4Address')].value"
}

Template:

{
  "privateIp": "<privateIp>"
}

Output:

{
  "privateIp": "10.193.133.18"
}

Everything worked fine until I pressed the Update rule button. It showed the error message:

InputPath for target Id8c917377-af84-4c9d-bb5f-xxxxxxx is invalid.

Do I misconfigure the input transformer? Or does AWS EventBridge input transformer not support JsonPath filter expressions?


Solution

  • Please see https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html#eb-transform-input-examples. For arrays, you'd need to use index references.