Необходимо указать только один --local-secondary-indexes
, например
до
--local-secondary-indexes \
'IndexName=index-1,KeySchema=[{AttributeName=type,KeyType=HASH},{AttributeName=sk1,KeyType=RANGE}],Projection={ProjectionType=INCLUDE,NonKeyAttributes=[A,B,C,D]}' \
--local-secondary-indexes \
'IndexName=index-2,KeySchema=[{AttributeName=type,KeyType=HASH},{AttributeName=sk2,KeyType=RANGE}],Projection={ProjectionType=INCLUDE,NonKeyAttributes=[B,D,F,H]}' \
После
--local-secondary-indexes \
'IndexName=index-1,KeySchema=[{AttributeName=type,KeyType=HASH},{AttributeName=sk1,KeyType=RANGE}],Projection={ProjectionType=INCLUDE,NonKeyAttributes=[A,B,C,D]}' \
'IndexName=index-2,KeySchema=[{AttributeName=type,KeyType=HASH},{AttributeName=sk2,KeyType=RANGE}],Projection={ProjectionType=INCLUDE,NonKeyAttributes=[B,D,F,H]}' \
Финал
aws dynamodb create-table \
--table-name test_table_name \
--attribute-definitions \
AttributeName=type,AttributeType=S \
...
--key-schema \
AttributeName=type,KeyType=HASH \
AttributeName=id,KeyType=RANGE \
--provisioned-throughput \
ReadCapacityUnits=5,WriteCapacityUnits=5 \
--local-secondary-indexes \
'IndexName=index-1,KeySchema=[{AttributeName=type,KeyType=HASH},{AttributeName=sk1,KeyType=RANGE}],Projection={ProjectionType=INCLUDE,NonKeyAttributes=[A,B,C,D]}' \
'IndexName=index-2,KeySchema=[{AttributeName=type,KeyType=HASH},{AttributeName=sk2,KeyType=RANGE}],Projection={ProjectionType=INCLUDE,NonKeyAttributes=[B,D,F,H]}' \
--region us-east-1