Aws-cli: Alguém pode me ajudar a criar uma tabela do DynamoDB com índice secundário local usando AWS cli?

Criado em 16 jun. 2016  ·  3Comentários  ·  Fonte: aws/aws-cli

guidance service-api

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} '

Todos 3 comentários

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} '

Esta página foi útil?
0 / 5 - 0 avaliações