Does anybody know how to configure this EventBridg...
# help
a
Does anybody know how to configure this EventBridge Target attributes on CDK?
o
Here’s what I have:
Copy code
import { RuleTargetInput } from '@aws-cdk/aws-events';

bus.addRules(this, {
      run: {
        targets: [
          {
            queue, // target is SQS queue
            targetProps: {
              message: RuleTargetInput.fromEventPath('$.detail'),
            },
          },
        ],
        eventPattern: {
          source: [source],
          detailType: [detailType],
        },
      },
    });
Just started using it
a
Niceeee.
This is what I was looking for!
@Omi Chowdhury are you using eventBridge from CDK? or from SST?
o
SST
a
Oh nice, I didn’t know that existed.
I was using from CDK.
o
Yup Frank added it last month - and the docs have a bunch of examples
a
Yeah, I have to migrate it.
@Omi Chowdhury have you been able to define a name?
I can’t find attribute
eventBusName
.
Oh found it:
Copy code
eventBridgeEventBus: {
    eventBusName: "MyEventBus",
  },
o
I have a eventbridge created via sls so I import it:
Copy code
this.bus = new EventBus(this, 'FragmentBus', {
      eventBridgeEventBus: events.EventBus.fromEventBusArn(
        this,
        'ImportedFragmentBus',
        props.project.aws.eventbridge_arn
      ),
    });
a
Nice!
Thanks for sharing!
@Omi Chowdhury the queue that you added there, is it considered a DLQ?
Or it’s just a target?
o
It’s a target, has another Queue as its DLQ if the function processing the event fails
a
Oh I see.
But in my screenshot, looks like the Target already knows the DQL.
Is that the case for you? is it populating the DLQ?
o
EB and SQS both support DLQs
a
Ok I see.
Makes sense.
I’m trying to figure out how to assign DQL to EB.
Without a queue, haha.
o
targetProps supports deadLetterQueue
a
Ohh found it!
AMAZING.