title: errorMessage: "event is not defined" in lambda function nodejs
body: <p>I am trying to run a lambda function attached to an API gateway GET request and below is the code</p>
  
  <pre><code>const AWS = require('aws-sdk');
  const s3 = new AWS.S3();
  
  const bucketName = "dhaval-upload";
  
  let params = {
          Bucket: bucketName, 
          Key: event.fileName
  };
  
  exports.handler = async (event, context, callback) =&gt; {
      return await s3.getObject(params).promise()
      .then((res) =&gt; {
          return "abcd";
          // return res.Body.toString('utf-8');
      })
      .catch((err) =&gt; {
          return err;
      });
  };
  </code></pre>
  
  <p>but I am getting the below error</p>
  
  <pre><code>errorMessage: "event is not defined"
  errorType: "ReferenceError"
  </code></pre>
  
  <p>But I don't understand the reason for this as I have another POST request running perfectly..</p>
  
  <p>Any help will be highly appreciated</p>