I have a lambda layer file that contains an enum definition (which will be used in various lambda functions) as shown below:
exports enum EventTypes {
Create,
Delete,
Update,
}
Initially, everything was working well as I tested it in different lambda functions. However, as I added more interface definitions in the same file and imported them into my implementation code, the structure transformed into this:
exports enum EventTypes {
Create,
Delete,
Update,
}
export interface ProjectEvent {
eventType: EventTypes;
}
export interface CreateEvent extends ProjectEvent {
userId: string;
}
export interface DeleteEvent extends ProjectEvent {
userList: string[];
}
export interface UpdateEvent extends ProjectEvent {
userList: string[];
}
Unfortunately, with this updated version of the file, I faced issues while trying to build the project successfully. My query is: Could there be any constraints that I overlooked when integrating TypeScript with Lambda layer?
For reference, here are the resources I consulted to set up my TypeScript-AWS integration:
[1] https://github.com/aws/aws-sam-cli/issues/2636
[2]