-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem being solved
In the BaseNodeJsFunction construct the field eventType is limited to this enum:
export enum EventType {
Cloudwatch = 'cloudwatch',
Http = 'http',
CustomResource = 'custom-resource',
}That does not cover all "common" AWS events (e.g. SQS, StepFunctions, EventBridge, etc) and it makes consuming the construct slightly confusing for those scenarios.
And as a consumer of the construct it seems you have to reccur to using a custom resource:
new BaseNodeJsFunction(
this,
'my-function-name',
{
eventType: EventType.CustomResource,
baseCodePath: 'src/handlers',Proposal
- Improve the enum list to include more event types.
- Allow sending any
stringvalue if the consumer wishes to standardize his project in his own setup without having to always useentry
Examples of the proposal:
new BaseNodeJsFunction(
this,
'my-function-name',
{
eventType: EventType.Sqs,
baseCodePath: 'src/handlers',
new BaseNodeJsFunction(
this,
'my-function-name',
{
eventType: EventType.StepFunction,
baseCodePath: 'src/handlers',
new BaseNodeJsFunction(
this,
'my-function-name',
{
eventType: 'my-custom-event-type',
baseCodePath: 'src/handlers',Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request