title: CloudFormation insists my DynamoDB creation JSON is invalid .. but I can't see how
body: <p>Here's (the DynamoDB part of) my Troposphere-generated JSON:</p>
  
  <pre><code>"sandbox": {
          "Properties": {
              "AttributeDefinitions": [
                  {
                      "AttributeName": "audit_id",
                      "AttributeType": "S"
                  },
                  {
                      "AttributeName": "status",
                      "AttributeType": "S"
                  },
                  {
                      "AttributeName": "filename",
                      "AttributeType": "S"
                  },
                  {
                      "AttributeName": "file_detected_dt",
                      "AttributeType": "S"
                  },
                  {
                      "AttributeName": "time_taken",
                      "AttributeType": "N"
                  },
                  {
                      "AttributeName": "number_rows_processed_file",
                      "AttributeType": "N"
                  },
                  {
                      "AttributeName": "number_rows_created_db",
                      "AttributeType": "N"
                  },
                  {
                      "AttributeName": "info_messages",
                      "AttributeType": "S"
                  }
              ],
              "KeySchema": [
                  {
                      "AttributeName": "audit_id",
                      "KeyType": "HASH"
                  }
              ],
              "ProvisionedThroughput": {
                  "ReadCapacityUnits": {
                      "Ref": "ReadCapacityUnits"
                  },
                  "WriteCapacityUnits": {
                      "Ref": "WriteCapacityUnits"
                  }
              }
          },
          "Type": "AWS::DynamoDB::Table"
      }
  </code></pre>
  
  <p>CloudFormation gives me this error on trying to spin up the VPC:  <code>Property AttributeDefinitions is inconsistent with the KeySchema of the table and the secondary indexes</code>.</p>
  
  <p>But ... is it? I'm specifying <code>audit_id</code> as a lone key, and it definitely exists within the AttributeDefinitions list. I'm very new to CF (and Dynamo, for that matter) so I may well be missing something extremely obvious, but it's not apparent to me at the moment.</p>
  
  <p>I've googled around and only really found one mention of this error, and it was more to do with a layer between developer and CF, rather than CF itself.</p>
  
  <p>Can anyone point out what's wrong with my template?</p>