Skip to content

Instantly share code, notes, and snippets.

@achad4
Created February 5, 2023 16:48
Show Gist options
  • Save achad4/09660a48b92e66e74875cbc2f6817a4c to your computer and use it in GitHub Desktop.
Save achad4/09660a48b92e66e74875cbc2f6817a4c to your computer and use it in GitHub Desktop.
import boto3
dynamodb = boto3.resource("dynamodb")
params = {
'TableName': "customer_purchase_ts",
"KeySchema": [
{"AttributeName": "customer_id", "KeyType": "HASH"},
{"AttributeName": "transaction_date_epoch", "KeyType": "RANGE"}
],
"AttributeDefinitions": [
{"AttributeName": "customer_id", "AttributeType": "S"},
{"AttributeName": "transaction_date_epoch", "AttributeType": "N"},
],
#Other settings...
}
table = dynamodb.create_table(**params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment