Last active
December 20, 2018 22:50
-
-
Save ChristianRich/28402d41a28c9ed2e52be1c731a112d2 to your computer and use it in GitHub Desktop.
AWS create DynamoDB tables on localhost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/dynamodb_local_latest | |
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb | |
aws dynamodb create-table \ | |
--endpoint-url http://localhost:8000 \ | |
--table-name pricing-api-tst-menu-dyn \ | |
--attribute-definitions \ | |
AttributeName=id,AttributeType=S \ | |
AttributeName=storeId,AttributeType=S \ | |
--key-schema \ | |
AttributeName=id,KeyType=HASH \ | |
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \ | |
--global-secondary-indexes \ | |
IndexName=store-index,KeySchema=["{AttributeName=storeId,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" | |
aws dynamodb create-table \ | |
--endpoint-url http://localhost:8000 \ | |
--table-name customer-tst-customers-dyn \ | |
--attribute-definitions \ | |
AttributeName=id,AttributeType=S \ | |
--key-schema \ | |
AttributeName=id,KeyType=HASH \ | |
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \ | |
aws dynamodb create-table \ | |
--endpoint-url http://localhost:8000 \ | |
--table-name customer-tst-customer-attributes-dyn \ | |
--attribute-definitions \ | |
AttributeName=id,AttributeType=S \ | |
AttributeName=value,AttributeType=S \ | |
AttributeName=valueHash,AttributeType=S \ | |
AttributeName=customerId,AttributeType=S \ | |
--key-schema \ | |
AttributeName=id,KeyType=HASH \ | |
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \ | |
--global-secondary-indexes \ | |
IndexName=value-index,KeySchema=["{AttributeName=value,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \ | |
IndexName=valueHash-index,KeySchema=["{AttributeName=valueHash,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" \ | |
IndexName=customer-index,KeySchema=["{AttributeName=customerId,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" | |
aws dynamodb create-table \ | |
--endpoint-url http://localhost:8000 \ | |
--table-name payments-api-tst-payments-dyn \ | |
--attribute-definitions \ | |
AttributeName=id,AttributeType=S \ | |
AttributeName=referenceId,AttributeType=S \ | |
--key-schema \ | |
AttributeName=id,KeyType=HASH \ | |
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \ | |
--global-secondary-indexes \ | |
IndexName=reference-index,KeySchema=["{AttributeName=referenceId,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" | |
aws dynamodb create-table \ | |
--endpoint-url http://localhost:8000 \ | |
--table-name order-tst-order-dyn \ | |
--attribute-definitions \ | |
AttributeName=id,AttributeType=S \ | |
AttributeName=status,AttributeType=S \ | |
--key-schema \ | |
AttributeName=id,KeyType=HASH \ | |
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 \ | |
--global-secondary-indexes \ | |
IndexName=status-index,KeySchema=["{AttributeName=status,KeyType=HASH}"],Projection="{ProjectionType=ALL}",ProvisionedThroughput="{ReadCapacityUnits=10,WriteCapacityUnits=10}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html