HttpEventBridgeIntegrationProps Struct
Properties to initialize HttpEventBridgeIntegration.
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,
}),
});
Properties
eventBusRefEventBusReferenceevent_bus_refEventBusReferenceeventBusRefEventBusReferenceEventBusRefEventBusReferenceEventBusRefEventBusReferencerequired#EventBridge event bus that integrates with API Gateway.
parameterMappingParameterMappingparameter_mappingParameterMappingparameterMappingParameterMappingParameterMappingParameterMappingParameterMappingParameterMapping#Specifies how to transform HTTP requests before sending them to the backend.
Default: set Detail to $request.body.Detail, DetailType to $request.body.DetailType, Source to $request.body.Source, and EventBusName to the event bus name from eventBusRef.
notes
When not provided, a default mapping will be used that expects the incoming request body to contain the fields Detail, DetailType, and Source.
The EventBusName is automatically included from eventBusRef in all cases, even when a custom parameterMapping is provided (unless explicitly overridden). This ensures consistency and eliminates redundant configuration.
subtypeHttpIntegrationSubtypesubtypeHttpIntegrationSubtypesubtypeHttpIntegrationSubtypeSubtypeHttpIntegrationSubtypeSubtypeHttpIntegrationSubtype#The subtype of the HTTP integration.
Default: HttpIntegrationSubtype.EVENTBRIDGE_PUT_EVENTS
Only subtypes starting with EVENTBRIDGE_ can be specified.