EventBusReference Struct
A reference to a EventBus resource.
Example
ts
import * as events from 'aws-cdk-lib/aws-events';
import { HttpEventBridgeIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
declare const bus: events.IEventBus;
declare const httpApi: apigwv2.HttpApi;
// default integration (PutEvents)
httpApi.addRoutes({
path: '/default',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpEventBridgeIntegration('DefaultEventBridgeIntegration', {
eventBusRef: bus.eventBusRef,
}),
});
// explicit subtype
httpApi.addRoutes({
path: '/put-events',
methods: [apigwv2.HttpMethod.POST],
integration: new HttpEventBridgeIntegration('ExplicitSubtypeIntegration', {
eventBusRef: bus.eventBusRef,
subtype: apigwv2.HttpIntegrationSubtype.EVENTBRIDGE_PUT_EVENTS,
}),
});