#!/bin/sh
set -e

echo "create dynamodb table: ${AWS_DYNAMO_TABLE}"

yarn awslocal dynamodb create-table \
  --table-name $AWS_DYNAMO_TABLE \
  --attribute-definitions \
    AttributeName=partitionKey,AttributeType=S \
    AttributeName=sortKey,AttributeType=N \
  --key-schema \
    AttributeName=partitionKey,KeyType=HASH \
    AttributeName=sortKey,KeyType=RANGE \
  --billing-mode PAY_PER_REQUEST

echo "dynamodb table created: ${AWS_DYNAMO_TABLE}"