title: Terraform + DynamoDB: All attributes must be indexed
body: <p>I want to create a Terraform configuration for DynamoDB table with multiple (> 10) attributes. And I have no need to add all attributes as an index to 
  <code>global_secondary_index</code> or <code>local_secondary_index</code>.
  But when I run <code>terraform plan</code> command I have next error:</p>
  
  <p><code>All attributes must be indexed. Unused attributes: ...</code> </p>
  
  <p>I found the validation check in the Terraform repository in <a href="https://github.com/terraform-providers/terraform-provider-aws/blob/v1.14.0/aws/validators.go#L1725-L1739" rel="noreferrer" title="validateDynamoDbTableAttributes">validateDynamoDbTableAttributes</a> function. </p>
  
  <p>But also as I know the best practice is that <code>each table in DynamoDB is limited to a maximum of five global secondary indexes and five local secondary indexes</code> from <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-indexes-general.html" rel="noreferrer">General Guidelines for Secondary Indexes in DynamoDB</a>.</p>
  
  <p>And since I have more than 10 attributes it looks like a problem to me.  </p>
  
  <p>What I would like to understand why all attributes must be indexed and what to do in case if you have  a big number of attributes.</p>
  
  <p>Thanks!</p>