How do you receive an event from AWS event bridge within a dotnet core lambda?

Viewed 1861

I am unable to find an example of how to receive an event from AWS event bridge using dotnet core (3.1 preferably). Thanks

1 Answers

Include in your project the package Amazon.Lambda.CloudWatchEvents and wrap your event with CloudWatchEvent<T>

 public void EventBridgeTriggerHandler(CloudWatchEvent<object> input, ILambdaContext context)
 {
    var payloadModel = JsonConvert.SerializeObject(input);
    Console.WriteLine($"Input:..{payloadModel}");
 }

object can be substituted with your event class.

Related