Lambda -> EventBridge

πŸ”₯ Import

import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as destinations from 'aws-cdk-lib/aws-lambda-destinations';

import * as events from '@aws-cdk/aws-events';

πŸ”₯ Code

declare const myFunction: lambda.Function;
declare const myEventBus: events.EventBus;

myFunction.addEventSource(new destinations.EventBridgeDestination(myEventBus));

Last updated