These are chat archives for aws/aws-cli

May 2017
May 24 2017 06:37

hi all, i am learning dynamodb and following the example from the documentation of aws. Stuck at this section where I need to create a global index for the reply table. The following syntax throws the error

'Error parsing parameter '--global-secondary-indexes': Expected: ',', received: '}' for input:'

the following is the complete code sample for the aws CLI:

aws dynamodb create-table \
--table-name \
Reply \
--attribute-definitions \
AttributeName=Id,AttributeType=S \
AttributeName=ReplyDateTime,AttributeType=S \
AttributeName=PostedBy,AttributeType=S \
AttributeName=Message,AttributeType=S \
--key-schema \
AttributeName=Id,KeyType=HASH \
AttributeName=ReplyDateTime,KeyType=RANGE \
--global-secondary-indexes \
IndexName=PostedBy-Message-Index,KeySchema=["{AttributeName=PostedBy,KeyType=HASH}","{AttributeName=Message,KeyType=RANGE}"],Projection="{ProjectionType=ALL,NonKeyAttributes=["key"]}}",ProvisionedThroughput="{ReadCapacityUnits=1,WriteCapacityUnits=1}" \
--provisioned-throughput \
ReadCapacityUnits=1,WriteCapacityUnits=1 \
--endpoint-url \

hope someone could help point out where i am going wrong :)

Kacper Skory
May 24 2017 07:49
@ppremk "{ProjectionType=ALL,NonKeyAttributes=["key"]}}"
you've got }} here instead of }.
Also the quoting looks weird, I think you don't have to use " in shorthand syntax
May 24 2017 08:35
@kskory thank you for pointing out. I am going to try it out now