title: C# .NET Core AWS Lambda Function Handler Signature for Cloudwatch Event
body: <p>I am trying to write a Lambda function in C# (.NET Core) that will handle when a CloudWatch event occurs in my account. I am using the Serverless Application Framework ( <a href="https://www.serverless.com/" rel="nofollow noreferrer">https://www.serverless.com/</a> ) and have previously been successful with writing the handler code to respond to ApiGateway Requests/events. For the ApiGateway request handlers, the methods signature always had the same two parameters:</p>
  
  <p>public APIGatewayProxyResponse SampleHandler(RequestAPIGatewayProxyRequest request, ILambdaContext context)</p>
  
  <p>Per the docs ( <a href="https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html</a> ), the first parameter is defined as the "inputType" and is typically specific to the event that trips the function and the second parameter is the generic Lambda function context information. Currently, I've been unsuccessful in finding the corresponding object type of a Cloudwatch event.</p>
  
  <p>My serverless application framework YAML file has the event for wired up like so:</p>
  
  <pre><code>functions:
    NewRevision:
      handler:  CsharpHandlers::AwsDotnetCsharp.Handlers::NewDataExchangeSubscriptionRevision
      memorySize: 1024 # optional, in MB, default is 1024
      timeout: 20 # optional, in seconds, default is 6
      events:
        - cloudwatchEvent:
            event:
              source:
                - 'aws.dataexchange'
              detail-type:
                - 'Revision Published To Data Set'
  </code></pre>
  
  <p>My question is, does anyone know what the appropriate object type that should be used in the method signature for a CloudWatch event?</p>