Get name of Cloud watch event triggered lambda function

809 Views Asked by At

I have multiple cloud watch events triggering a lambda function . Is it possible to get name of event in lambda function so that I can know which is triggering lambda function and need to do some changes accordingly.

1

There are 1 best solutions below

2
Nick On

Formalising response from the comments. @A.Amayreh

Simply add it in the event payload while creating it.

Rule Payload:

{
 ...,
 "event_name":"my_event_1"
}

This way your lambda knows the source event while executing.