title: Dotnet Core AWS Lambda For Cognito Post Confirmation Trigger Completion
body: <p>I use Cognito User Pools and for a Post Sign Up Confirmation Trigger I am writing a dotnet core lambda to do some followup work. I stared by simple logging out what I get in and do some work from there. Thing is I realised my logging out works but then when the Function should &quot;finish&quot; it fails to do so. It produces the following error - Code: <code>InvalidLambdaResponseException</code>, Message: <code>Unrecognizable lambda output</code>. Here is my <code>FunctionHandler</code>:</p>
  <pre><code>[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
  ...
  public async Task FunctionHandler(JObject input, ILambdaContext context)
  {
      context.Logger.LogLine($&quot;INPUT:{input}&quot;);
      //Do some work      
  }
  </code></pre>
  <p>I can only find a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html#aws-lambda-triggers-post-confirm-tutorials" rel="nofollow noreferrer">NodeJS example</a> for Post Confirmation Lambda Trigger:</p>
  <pre><code>exports.handler = (event, context, callback) =&gt; {
      console.log(event);
  
      if (event.request.userAttributes.email) {
              sendEmail(event.request.userAttributes.email, &quot;Congratulations &quot; + event.userName + &quot;, you have been confirmed: &quot;, function(status) {
  
              // Return to Amazon Cognito
              callback(null, event);
          });
      } else {
          // Nothing to do, the user's email ID is unknown
          callback(null, event);
      }
  };
  </code></pre>
  <p>In this example, it's simple - You simple invoke the <code>callback</code>, but there is no such callback for the dotnet core handlers.</p>
  <p>I have also tried changing the function to simply return a basic string like: <code>return &quot;OK&quot;;</code>, but it also does not like that and gives me the same error.</p>
  <p>How am I suppose to close of this process for the Lambda?</p>