'How can I define a EventBridge trigger for my Lambda?

See attached image (the region in blue). I want to find a way to import (or define) that EventBridge trigger for my Lambda in Pulumi.

I haven't been able to find anything for it in the documentation, or by searching the web.

The closest I found was Aws.CloudWatch.EventTarget, but it seems to just define an event target, and not a trigger.

I am using C# here, but the question should be language agnostic since I am just looking for what that resource type is called, and how to import it.

enter image description here



Solution 1:[1]

This is still in the CloudWatch target. In TypeScript, if you define it like so:

const rule = new aws.cloudwatch.EventRule("example", {
    eventBusName: bus.name,

    // Specify the event pattern to watch for.
    eventPattern: JSON.stringify({
        source: ["my-event-source"],
    }),
});

You'll get the result you expect

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jaxxstorm