title: Number of attributes in key schema must match the number of attributes defined in attribute definitions
body: <p>I’m trying to create a simple table using DynamoDB JavaScript shell and I’m getting this exception:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;message&quot;: &quot;The number of attributes in key schema must match the number of attributes defined in attribute definitions.&quot;,
    &quot;code&quot;: &quot;ValidationException&quot;,
    &quot;time&quot;: &quot;2015-06-16T10:24:23.319Z&quot;,
    &quot;statusCode&quot;: 400,
    &quot;retryable&quot;: false
  }
  </code></pre>
  <p>Below is the table I’m trying to create:</p>
  <pre class="lang-js prettyprint-override"><code>var params = {
    TableName: 'table_name',
    KeySchema: [
      {
        AttributeName: 'hash_key_attribute_name',
        KeyType: 'HASH'
      }
    ],
    AttributeDefinitions: [
      {
        AttributeName: 'hash_key_attribute_name',
        AttributeType: 'S'
      },
      {
        AttributeName: 'attribute_name_1',
        AttributeType: 'S'
      }
    ],
    ProvisionedThroughput: {
      ReadCapacityUnits: 1,
      WriteCapacityUnits: 1
    }
  };
  dynamodb.createTable(params, function(err, data) {
    if (err) print(err);
    else print(data);
  });
  </code></pre>
  <p>However if I add the second attribute to the <code>KeySchema</code>, it works fine. Below a the working table:</p>
  <pre class="lang-js prettyprint-override"><code>var params = {
    TableName: 'table_name',
    KeySchema: [
      {
        AttributeName: 'hash_key_attribute_name',
        KeyType: 'HASH'
      },
      {
        AttributeName: 'attribute_name_1',
        KeyType: 'RANGE'
      }
    ],
    AttributeDefinitions: [
      {
        AttributeName: 'hash_key_attribute_name',
        AttributeType: 'S'
      },
      {
        AttributeName: 'attribute_name_1',
        AttributeType: 'S'
      }
    ],
    ProvisionedThroughput: {
      ReadCapacityUnits: 1,
      WriteCapacityUnits: 1
    }
  };
  dynamodb.createTable(params, function(err, data) {
    if (err) print(err);
    else print(data);
  });
  </code></pre>
  <p>I don’t want to add the range to key schema. Any idea how to fix it?</p>