title: AWS dynamodb endpoints is not correct
body: <p>I am using <code>sails js</code> (latest version 1.0) with DynamoDB (I have installed Sails js framework at my local machine) but when  have tried to reading the records from <code>aws dynamodb</code> then its giving error. I have tried below cases and every time getting different errors.</p>
  
  <pre><code>var AWS = require("aws-sdk");
  AWS.config.update({
    region: "ap-southeast-2",
    endpoint: "http://localhost:1337"
  });
  
  var docClient = new AWS.DynamoDB.DocumentClient();
  var table = "SMSGateway_User";
  var email = 'yoursptc@gmail.com';
  
  var params = {
      TableName: table,
      Key:{
          "userEmail": email
      }
  };
  
  docClient.get(params, function(err, data) {
      if (err) {
          console.log("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
      } else {
          console.log("GetItem succeeded:", JSON.stringify(data, null, 2));
      }
  });
  </code></pre>
  
  <p><strong>Error which I am getting:</strong></p>
  
  <blockquote>
    <p>Unable to read item. Error JSON: {   "message": "Missing credentials
    in config",   "errno": "ETIMEDOUT",   "code": "CredentialsError",<br>
    "syscall": "connect",   "address": "169.254.169.254",   "port": 80,<br>
    "time": "2018-10-05T05:05:26.002Z",   "originalError": {
        "message": "Could not load credentials from any providers",
        "errno": "ETIMEDOUT",
        "code": "CredentialsError",
        "syscall": "connect",
        "address": "169.254.169.254",
        "port": 80,
        "time": "2018-10-05T05:05:26.001Z",
        "originalError": {
          "errno": "ETIMEDOUT",
          "code": "ETIMEDOUT",
          "syscall": "connect",
          "address": "169.254.169.254",
          "port": 80,
          "message": "connect ETIMEDOUT 169.254.169.254:80"
        }   } }</p>
  </blockquote>
  
  <p><strong>When I changed and add below code for config:</strong></p>
  
  <pre><code>AWS.config.update({
    accessKeyId: 'XXXXXXXXXXXX',
    secretAccessKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
    region: "ap-southeast-2",
    endpoint: "http://localhost:1337"
  });
  </code></pre>
  
  <p>Then getting below error:</p>
  
  <blockquote>
    <p>Unable to read item. Error JSON: {   "message": "Not Found",   "code":
    "UnknownError",   "statusCode": 404,   "time":
    "2018-10-05T06:08:28.707Z",   "retryable": false,   "retryDelay":
    47.4917958614573 }</p>
  </blockquote>
  
  <p><strong>When I change end point and put ARN</strong></p>
  
  <pre><code>AWS.config.update({
    accessKeyId: 'XXXXXXXXXXXX',
    secretAccessKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
    region: "ap-southeast-2",
    endpoint: "arn:aws:dynamodb:ap-southeast-2:420344081058:table/SMSGateway_User"
  });
  </code></pre>
  
  <p><strong>Error is:</strong></p>
  
  <blockquote>
    <p>Unable to read item. Error JSON: {   "message": "Inaccessible host:
    <code>arn'. This service may not be available in the</code>ap-southeast-2'
    region.",   "code": "UnknownEndpoint",   "region": "ap-southeast-2",<br>
    "hostname": "arn",   "retryable": true,   "originalError": {
        "message": "getaddrinfo ENOTFOUND arn arn:443",
        "errno": "ENOTFOUND",
        "code": "NetworkingError",
        "syscall": "getaddrinfo",
        "hostname": "arn",
        "host": "arn",
        "port": 443,
        "region": "ap-southeast-2",
        "retryable": true,
        "time": "2018-10-05T06:17:21.352Z"   },   "time": "2018-10-05T06:17:21.352Z" }</p>
  </blockquote>
  
  <p>Can anyone tell me which one is correct end point to read,create,update and delete data in dynamoDB.</p>
  
  <p>I am following this reference: <a href="https://docs.amazonaws.cn/en_us/amazondynamodb/latest/developerguide/GettingStarted.NodeJs.03.html#GettingStarted.NodeJs.03.02" rel="nofollow noreferrer">https://docs.amazonaws.cn/en_us/amazondynamodb/latest/developerguide/GettingStarted.NodeJs.03.html#GettingStarted.NodeJs.03.02</a></p>
  
  <p>Any help will be appreciated.</p>