Para un LSI, usaría --local-secondary-indexes 'IndexName=string,KeySchema=[{AttributeName=string,KeyType=string},{AttributeName=string,KeyType=string}],Projection={ProjectionType=string,NonKeyAttributes=[string,string]}'
en su llamada create-table
.
Si sigues teniendo problemas, ven a charlar con nosotros en nuestra sala de gitter. Cierre a favor de gitter.
Hola Jamesls,
aws dynamodb create-table --nombre de tabla XYZ --attribute-definition AttributeName = Id, AttributeType = N AttributeName = Name, AttributeType = S AttributeName = Sexo, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Nombre, KeyType = RANGE --provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secondary-indexes 'IndexName = string, KeySchema = [{AttributeName = Gender, KeyType = RANGE}, {AttributName = Id, KeyType = HASH}], Proyección = {Tipo de proyección = TODOS} '
He usado el código anterior para crear una tabla. Pero recibo el error:
_Parámetro de análisis de errores '--local-secondary-indexes': esperado: '=', recibido: ''
'para entrada:
'IndexName = string, KeySchema = [{AttributeName = Gender, KeyType = RANGE}, {AttributName =
Id, KeyType = HASH}], Proyección = {ProjectionType = ALL} '_
Gracias por su apoyo
aws dynamodb create-table --nombre-tabla XYZ --attribute-definition AttributeName = Id, AttributeType = N AttributeName = Name, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Nombre, KeyType = RANGE - -provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secundaria-indexes 'IndexName = idx1, KeySchema = [{AttributeName = Id, KeyType = HASH}, {AttributeName = Name, KeyType = RANGE}], Proyección = { ProjectionType = ALL} '
Comentario más útil
aws dynamodb create-table --nombre-tabla XYZ --attribute-definition AttributeName = Id, AttributeType = N AttributeName = Name, AttributeType = S --key-schema AttributeName = Id, KeyType = HASH AttributeName = Nombre, KeyType = RANGE - -provisioned-throughput ReadCapacityUnits = 5, WriteCapacityUnits = 5 --local-secundaria-indexes 'IndexName = idx1, KeySchema = [{AttributeName = Id, KeyType = HASH}, {AttributeName = Name, KeyType = RANGE}], Proyección = { ProjectionType = ALL} '