title: s3.getObject(...).createReadStream is not a function
body: <p>I am trying to send a file from my s3 bucket to the client with my NodeJS application. This is what I have so far:</p>
  <pre class="lang-js prettyprint-override"><code>import { S3 } from '@aws-sdk/client-s3';
  
  const BUCKET_NAME = process.env.S3_BUCKET_NAME;
  
  const s3 = new S3({
      region: 'ap-southeast-2',
      httpOptions: {
          connectTimeout: 2 * 1000,
          timeout: 60 * 1000,
      },
  });
  
  router.get('/download/:id', async (req, res) =&gt; {
      console.log('api: GET /download/:id');
      console.log('req.params.id: ', req.params.id);
      const result = await getRequiredInfo(req.params.id);
      if (typeof result !== 'number') {
          res.attachment(result.filename);
          await s3
              .getObject({
                  Bucket: BUCKET_NAME,
                  Key: result.location,
              })
              .createReadStream()
              .pipe(res);
      } else {
          res.sendStatus(result);
      }
  });
  </code></pre>
  <p>And when I run this code, I receive this:</p>
  <pre><code>(node:11224) UnhandledPromiseRejectionWarning: TypeError: s3.getObject(...).createReadStream is not a function
  </code></pre>
  <p>I wondered around on SO and looks like others are working fine with the combination of getObject and createReadStream. Is there something I am missing at this point? How should I send a file as a stream in the response?</p>