:loudspeaker: Update v0.37.0 now supports EventBr...
# general
f
📢 Update v0.37.0 now supports EventBridge!
Copy code
new EventBus(this, "MyBus", {
  rules: {
    myRule: {
      eventPattern: { source: ["aws.codebuild"] },
      targets: ["src/target1.main", "src/target2.main"],
    },
  },
});
sst.EventBus
currently supports Lambda and SQS as targets. If you need any other targets, drop me a line at anytime ✌️ More examples here - https://docs.serverless-stack.com/constructs/EventBus
a
I’ve been using 
import { EventBus } from "@aws-cdk/aws-events";
, what’s the difference with this construct?
t
The standard AWS one requires a bit more boilerplate to setup a rule and a target. This one lets you do that in a less verbose way
a
oh yes! Event sourcing, here I come. 😂🙏 Thanks guys, I was already hooked to sst, I believe sst is going to be the new express of serverless systems and IaC.
f
@Adrián Mouly yeah agreed with @thdxr, you also have the ability to set
defaultFunctionProps
for all Function targets
a
Thank, going to migrate to this construct 🙂
f
Just a headsup, it might cause your
EventBus
to get recreated, b/c the id for the EventBus in your CFN might change when you move things around.
a
Makes sense.