Para um LSI, você usaria --local-secondary-indexes 'IndexName=string,KeySchema=[{AttributeName=string,KeyType=string},{AttributeName=string,KeyType=string}],Projection={ProjectionType=string,NonKeyAttributes=[string,string]}'
em sua chamada create-table
.
Se você ainda estiver tendo problemas, venha conversar conosco em nossa sala de gitter. Fechando em favor de gitter.
Oi Jamesls,
aws dynamodb criar tabela --table-name XYZ --attribute-settings AttributeName = Id, AttributeType = N AttributeName = Nome, AttributeType = S AttributeName = Gênero, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Nome, KeyType = RANGE --provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = string, KeySchema = [{AttributeName = Gender, KeyType = RANGE}, {AttributName = Id, KeyType = HASH}], Projection = {ProjectionType = ALL} '
Usei o código acima para criar uma tabela. Mas estou recebendo o erro:
_Error parsing parameter '--local-secondary-indexes': Esperado: '=', recebido: ''
'para entrada:
'IndexName = string, KeySchema = [{AttributeName = Gender, KeyType = RANGE}, {AttributName =
Id, KeyType = HASH}], Projection = {ProjectionType = ALL} '_
Obrigado por seu apoio
aws dynamodb criar tabela --table-name XYZ --attribute-definition AttributeName = Id, AttributeType = N AttributeName = Nome, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Nome, KeyType = RANGE - -provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = idx1, KeySchema = [{AttributeName = Id, KeyType = HASH}, {AttributeName = Name, KeyType = RANGE}], Projection = { ProjectionType = ALL} '
Comentários muito úteis
aws dynamodb criar tabela --table-name XYZ --attribute-definition AttributeName = Id, AttributeType = N AttributeName = Nome, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Nome, KeyType = RANGE - -provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = idx1, KeySchema = [{AttributeName = Id, KeyType = HASH}, {AttributeName = Name, KeyType = RANGE}], Projection = { ProjectionType = ALL} '