Skip to content

Instantly share code, notes, and snippets.

@timelincoln7648
Created February 24, 2019 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timelincoln7648/23f8856314ee24772fdef9e9daa21047 to your computer and use it in GitHub Desktop.
Save timelincoln7648/23f8856314ee24772fdef9e9daa21047 to your computer and use it in GitHub Desktop.
# Local Accounts table
RESULT=$(aws dynamodb describe-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Accounts)
CODE=$?
if [ $? -eq 0 ]; then
aws dynamodb delete-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Accounts
fi
aws dynamodb create-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Accounts \
--key-schema AttributeName=uuid,KeyType=HASH \
--attribute-definitions AttributeName=uuidname,AttributeType=S \
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10
# Local Users table
RESULT=$(aws dynamodb describe-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Users)
CODE=$?
if [ $? -eq 0 ]; then
aws dynamodb delete-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Users
fi
aws dynamodb create-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Users \
--key-schema AttributeName=username,KeyType=HASH \
--attribute-definitions AttributeName=username,AttributeType=S \
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10
# Local Messages table
RESULT=$(aws dynamodb describe-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Messages)
CODE=$?
if [ $? -eq 0 ]; then
aws dynamodb delete-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Messages
fi
aws dynamodb create-table \
--region us-east-1 \
--endpoint-url $DYNAMODB_ENDPOINT \
--table-name test_Messages \
--key-schema AttributeName=room,KeyType=HASH AttributeName=message,KeyType=RANGE \
--attribute-definitions AttributeName=room,AttributeType=S AttributeName=message,AttributeType=S \
--provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment