我希望有人可以帮助我理解Dynamo CLI语法。
我无法从CLI创建全局二次索引。
在创建索引之前,我的脚本按预期运行:
当我添加索引时,出现错误:
我收到的错误信息是:
aws dynamodb create-table \
--table-name a.b.c \
--attribute-definitions \
AttributeName=TransactionID,AttributeType=S \
--key-schema \
AttributeName=TransactionID,KeyType=HASH \
--provisioned-throughput\
ReadCapacityUnits=5,WriteCapacityUnits=5 \
--endpoint-url $DATABASE_ENDPOINT_URL
当我添加索引时,出现错误:
aws dynamodb create-table \
--table-name a.b.c \
--attribute-definitions \
AttributeName=TransactionID,AttributeType=S \
AttributeName=BatchID,AttributeType=S \
AttributeName=TransactionStatus,AttributeType=S \
--key-schema \
AttributeName=TransactionID,KeyType=HASH \
--global-secondary-indexes IndexName=a.b.indexName,\
KeySchema=["{AttributeName=BatchID,KeyType=HASH}","{AttributeName=TransactionStatus,KeyType=RANGE}"],\
Projection="{ProjectionType=KEYS_ONLY}",\
ProvisionedThroughput="{ReadCapacityUnits=5,WriteCapacityUnits=5}"\
--provisioned-throughput\
ReadCapacityUnits=5,WriteCapacityUnits=5 \
--endpoint-url $DATABASE_ENDPOINT_URL
我收到的错误信息是:
Error parsing parameter '--global-secondary-indexes': Expected: '<second>', received: '<none>' for input: IndexName=a.b.indexName,
看起来这似乎是从示例中直接复制的。我还尝试过使用一些其他问题的示例文件,但仍然没有成功。