title: How to solve Runtime.HandlerNotFound Error in AWS Lambda
body: <p>I am creating a simple API and i want to create a function that stores the input data, however i consistently get the Runtime.HandlerNotFound error. </p>
  
  <p>I've checked the environment name (index.js) matches the handler (index.handler)</p>
  
  <pre><code>const AWS = require('aws-sdk');
  const dynamodb = new AWS.DynamoDB({region: 'us-east-2', apiVersion: '2012-08-10'});
  
  exports.fn = (event, context, callback) =&gt; {
      const params = {
          Item: {
              "UserId": {
                  N: event.userId
              },
              "firstname": {
                  S: event.firstname
              },
              "lastname": {
                  S: event.lastname
              },
              "email": {
                  S: event.email
              }
          },
          TableName: "contact-info"
      };
      dynamodb.putItem(params, function(err, data) {
          if (err) {
              console.log(err);
              callback(err);
          } else {
              console.log(data);
              callback(null, data);
          }
      });
  };
  </code></pre>
  
  <p>I am expecting the AWS Lambda test to return an empty object with no errors.</p>