I'm trying to create DynamoDB table with global index like this:
aws create-table \
--table-name test1 --attribute-definitions AttributeName=id,AttributeType=S AttributeName=consumerId,AttributeType=S \
--key-schema AttributeName=id,KeyType=HASH \
--global-secondary-indexes IndexName=consumerIdInd,KeySchema=[{AttributeName=consumerId,KeyType=HASH}],Projection={ProjectionType=ALL}
This returns:
Parameter validation failed: Invalid type for parameter GlobalSecondaryIndexes[0].KeySchema[0], value: AttributeName=consumerId, type: <class 'str'>, valid types: <class 'dict'> Invalid type for parameter GlobalSecondaryIndexes[1].KeySchema[0], value: KeyType=HASH, type: <class 'str'>, valid types: <class 'dict'>
How to fix this?