EventBridgeAdapter
@h4ad/serverless-adapter > EventBridgeAdapter
(class) EventBridgeAdapter
The adapter to handle requests from AWS EventBridge (Cloudwatch Events).
The option of responseWithErrors
is ignored by this adapter and we always call resolver.fail
with the error.
Signature:
export declare class EventBridgeAdapter extends AwsSimpleAdapter<EventBridgeEventAll>
Extends: AwsSimpleAdapter <EventBridgeEventAll >
Example
const eventBridgeForwardPath = '/your/route/eventbridge'; // default /eventbridge
const eventBridgeForwardMethod = 'POST'; // default POST
const adapter = new EventBridgeAdapter(\{ eventBridgeForwardPath, eventBridgeForwardMethod });
(constructor)
Default constructor
Signature:
constructor(options?: EventBridgeOptions);
Parameters
Parameter | Type | Description |
---|---|---|
options | (Optional) The options to customize the EventBridgeAdapter |
(method) canHandle
Signature:
canHandle(event: unknown): event is EventBridgeEventAll;
Parameters
Parameter | Type | Description |
---|---|---|
event | unknown |
Returns:
event is EventBridgeEventAll
(method) getAdapterName
Signature:
getAdapterName(): string;
Returns:
string