title: AWS S3 Inaccessible host
body: <p>I'm a beginner with AWS and I'm trying to connect to S3. I have a really simple export but I'm getting error message:</p>
  
  <pre><code>{"message":"Inaccessible host: `legal-systems-staging.s3.eu-central-1.amazonaws.com'. This service may not be available in the `eu-central-1' region.","code":"UnknownEndpoint","region":"eu-central-1","hostname":"legal-systems-staging.s3.eu-central-1.amazonaws.com","retryable":true,"originalError":{"message":"getaddrinfo ENOTFOUND legal-systems-staging.s3.eu-central-1.amazonaws.com 
  </code></pre>
  
  <p>To connect I have this code:</p>
  
  <pre><code>const AWS = require('aws-sdk');
  
  module.exports = function(customENV){ return function(req, res) {
      //get ENV variables
      const aws_accessKeyId = customENV.access_key;
      const aws_secretAccessKey = customENV.secret_access_key;
      const aws_region = customENV.s3_region;
      const aws_bucket = customENV.s3_bucket;
  
      //configuring the AWS environment
    AWS.config.update({
        region: aws_region,
        accessKeyId: aws_accessKeyId,
        secretAccessKey: aws_secretAccessKey
      });
  
    new AWS.S3().getObject({ Bucket: aws_bucket, Key: req.body.template }, function(err, data) {
        if (!err) { 
            res.send('good');
        } else {
            res.send(err);
        }
    });
  }};
  </code></pre>
  
  <p>Bucket in S3 Management Console has region EU (Frankfurt) and according <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html" rel="nofollow noreferrer">this list</a> it should be right.</p>
  
  <p>Credential are correct. What am I doing wrong?</p>