title: Why is my C# AWS Lambda not publishing my SNS message?
body: <p>I am new to C# and I am trying to build a handler function with Lambda to push messages to an SNS topic, this is what I have:</p>
  <pre class="lang-cs prettyprint-override"><code>using MessagePublisher;
  
  using Amazon.Lambda.Core;
  using Amazon.SimpleNotificationService;
  using Amazon.SimpleNotificationService.Model;
  
  
  // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
  [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]
  
  namespace SNSMessagePublisher
  {
      public class Function
      {
          public string PublishMessageHandler(NewMessage input, ILambdaContext context)
          {
              var client = new AmazonSimpleNotificationServiceClient(Amazon.RegionEndpoint.EUWest2);
              LambdaLogger.Log($&quot;Calling function name: {context.FunctionName}\n&quot;);
              var publishRequest = new PublishRequest(
                  &quot;arn:aws:sns:eu-west-2:123...9:TopicABC&quot;,
                  input.body);
              client.PublishAsync(publishRequest);
              return $&quot;Message Published: {input.body}&quot;;
          }
      }
  }
  </code></pre>
  <pre class="lang-cs prettyprint-override"><code>namespace MessagePublisher {
      public class NewMessage {
          public string body { get; set; }
      }
  }
  </code></pre>
  <p>I then trigger a set payload of:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;body&quot;: &quot;test body&quot;
  }
  </code></pre>
  <p>and in the CloudWatch logs, I get an output of:</p>
  <pre class="lang-sh prettyprint-override"><code>Calling function name: messagePublisher
  </code></pre>
  <p>And the Lambda console returns:</p>
  <pre class="lang-sh prettyprint-override"><code>&quot;Message Published: test body&quot;
  </code></pre>
  <p>However, the topic never actually receives a message.</p>