Aws-cli: Kann mir jemand helfen, eine DynamoDB-Tabelle mit lokalem sekundärem Index mit AWS cli zu erstellen?

Erstellt am 16. Juni 2016  ·  3Kommentare  ·  Quelle: aws/aws-cli

guidance service-api

Hilfreichster Kommentar

aws dynamodb create-table --table-name XYZ --attribute-definitions AttributeName=Id,AttributeType=N AttributeName=Name,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH AttributeName=Name,KeyType=RANGE - -provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --local-secondary-indexes 'IndexName=idx1,KeySchema=[{AttributeName=Id,KeyType=HASH},{AttributeName=Name,KeyType=RANGE}],Projection={ Projektionstyp=ALL}'

Alle 3 Kommentare

Bei einem LSI würden Sie --local-secondary-indexes 'IndexName=string,KeySchema=[{AttributeName=string,KeyType=string},{AttributeName=string,KeyType=string}],Projection={ProjectionType=string,NonKeyAttributes=[string,string]}' in Ihrem create-table Aufruf verwenden.

Wenn Sie immer noch Probleme haben, chatten Sie mit uns in unserem Gitterraum. Schluss zu Gunsten von gitter.

Hallo Jamesle,

aws dynamodb create-table --table-name XYZ --attribute-definitions AttributeName=Id,AttributeType=N AttributeName=Name,AttributeType=S AttributeName=Gender,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH AttributeName =Name,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}'

Ich habe den obigen Code verwendet, um eine Tabelle zu erstellen. Aber ich bekomme den Fehler:

_Fehler beim Parsing-Parameter '--local-secondary-indexes': Erwartet: '=', empfangen: ''
' für die Eingabe:
'IndexName=string,KeySchema=[{AttributeName=Gender,KeyType=RANGE},{AttributName=
Id,KeyType=HASH}],Projection={ProjectionType=ALL}'_

Danke für deine Unterstützung

aws dynamodb create-table --table-name XYZ --attribute-definitions AttributeName=Id,AttributeType=N AttributeName=Name,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH AttributeName=Name,KeyType=RANGE - -provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --local-secondary-indexes 'IndexName=idx1,KeySchema=[{AttributeName=Id,KeyType=HASH},{AttributeName=Name,KeyType=RANGE}],Projection={ Projektionstyp=ALL}'

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen