public function getDefinition()
    {
        $definition['KeySchema'] = $this->getDefinitionKeySchema();

        if ($this->isPrimary()) {
            $definition['AttributeDefinitions'] = $this->getDefinitionAttributes();
        } else {
            $definition['IndexName']  = $this->getName();
            $definition['Projection'] = $this->getDefinitionProjection();
        }

        if (!$this->isSecondaryLocal()) {
            $definition['ProvisionedThroughput'] = $this->getDefinitionProvisionedThroughput();
        }

        return $this->isPrimary() ? $definition :
            [$this->getDefinitionIndexType() => $definition];
    }