fix(pipes): read EventBridgeEventBusParameters for Source and DetailType (#589)

This commit is contained in:
Christine Nguyen authored and GitHub committed 2026-04-25 09:42:57 -05:00
1 parent e5b733a09d
commit 12c89ba751
2 files changed
+52 -4

No files matched your search

@@ -67,7 +67,7 @@ public class PipesTargetInvoker {
} else if (targetArn.contains(":sns:")) {
invokeSns(targetArn, payload, region);
} else if (targetArn.contains(":events:")) {
invokeEventBridge(targetArn, payload, region);
invokeEventBridge(targetArn, payload, region, tp);
} else if (targetArn.contains(":states:")) {
invokeStepFunctions(targetArn, payload, region);
} else {
@@ -94,13 +94,24 @@ public class PipesTargetInvoker {
LOG.debugv("Pipe delivered to SNS: {0}", arn);
}
private void invokeEventBridge(String arn, String payload, String region) {
private void invokeEventBridge(String arn, String payload, String region, JsonNode tp) {
String busName = arn.substring(arn.lastIndexOf('/') + 1);
String ebRegion = extractRegionFromArn(arn, region);
String source = "aws.pipes";
String detailType = "PipeForwarded";
if (tp != null) {
JsonNode ebParams = tp.path("EventBridgeEventBusParameters");
if (ebParams.has("Source")) {
source = ebParams.get("Source").asText();
}
if (ebParams.has("DetailType")) {
detailType = ebParams.get("DetailType").asText();
}
}
Map<String, Object> entry = Map.of(
"EventBusName", busName,
"Source", "aws.pipes",
"DetailType", "PipeForwarded",
"Source", source,
"DetailType", detailType,
"Detail", payload
);
eventBridgeService.putEvents(List.of(entry), ebRegion);