title: Missing region in AWS rekognition in node js
body: <pre><code>//Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  //PDX-License-Identifier: MIT-0 (For details, see https://github.com/awsdocs/amazon-rekognition-developer-guide/blob/master/LICENSE-SAMPLECODE.)
  
  
     const AWS = require('aws-sdk')
     const bucket        = 'bucket' // the bucketname without s3://
     const photo_source  = 'source.jpg'
     const photo_target  = 'target.jpg'
     const config = new AWS.Config({
       accessKeyId: process.env.AWS_ACCESS_KEY_ID,
       secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
       region: process.env.AWS_REGION
     })
     const client = new AWS.Rekognition();
     const params = {
       SourceImage: {
         S3Object: {
           Bucket: bucket,
           Name: photo_source
         },
       },
       TargetImage: {
         S3Object: {
           Bucket: bucket,
           Name: photo_target
         },
       },
       SimilarityThreshold: 70
     }
     client.compareFaces(params, function(err, response) {
       if (err) {
         console.log(err, err.stack); // an error occurred
       } else {
         response.FaceMatches.forEach(data =&gt; {
           let position   = data.Face.BoundingBox
           let similarity = data.Similarity
           console.log(`The face at: ${position.Left}, ${position.Top} matches with ${similarity} % confidence`)
         }) // for response.faceDetails
       } // if
     });
  </code></pre>
  <p>Above code is from official aws webpage (<a href="https://docs.aws.amazon.com/rekognition/latest/dg/faces-comparefaces.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/rekognition/latest/dg/faces-comparefaces.html</a>). The code is for implementing comparing faces in image using node js. When comparing images using the above code a error occurs which says missing region on config. Then when i checked the code eventhough config object is created in this code but it is not being used anywhere. Can someone tell me where i must use the config object. If the error is appearing due to any other reason please tell me the reason</p>