Is there a way to specify input path on an EventBr...
# sst
o
Is there a way to specify input path on an EventBridge Rule? Porting some stuff over from serverless, where it looks like:
Copy code
IndexLedgerLinesRule:
      Type: AWS::Events::Rule
      Properties:
        EventBusName: some=eb
        EventPattern:
          source:
            - some-source
          detail-type:
            - some-detail
        Targets:
          - Id: IndexLedgerLinesQ
            Arn: !GetAtt IndexLedgerLinesQ.Arn
            InputPath: '$.detail'
I saw that SST’s EventBridge overrides targets from the CDK version, which I think supports input paths (although haven’t tracked that down how that works yet)
f
Copy code
import * as events from "@aws-cdk/aws-events";

new EventBus(this, "Bus", {
  rules: {
    rule1: {
      ruleName: "MyRule",
      eventPattern: { source: ["aws.codebuild"] },
      targets: [
        {
          queue: MySstQueue,
          targetProps: {
            message: events.RuleTargetInput.fromEventPath("$.detail")
          }
        }
      ],
    },
  },
});
@Omi Chowdhury give this a try
o
Ahh didm’t notice the type of message