Skip to content

Instantly share code, notes, and snippets.

@asampatoor
Last active October 26, 2017 20:13
Show Gist options
  • Save asampatoor/d3955551d667fe02f5a7fe53b156e5d5 to your computer and use it in GitHub Desktop.
Save asampatoor/d3955551d667fe02f5a7fe53b156e5d5 to your computer and use it in GitHub Desktop.
from __future__ import print_function # Python 2/3 compatibility
import boto3
dynamodb = boto3.resource('dynamodb', region_name='us-east-1', endpoint_url="http://localhost:8000")
client = boto3.client('dynamodb')
table = dynamodb.create_table(
TableName='treatment_arm_pending',
KeySchema=[
{
'AttributeName': 'treatment_arm_id',
'KeyType': 'HASH'
},
{
'AttributeName': 'version',
'KeyType': 'RANGE'
}
],
AttributeDefinitions=[
{
'AttributeName': 'treatment_arm_id',
'AttributeType': 'S'
},
{
'AttributeName': 'version',
'AttributeType': 'S'
}
],
ProvisionedThroughput={
'ReadCapacityUnits': 100,
'WriteCapacityUnits': 100
}
)
response = client.describe_table(
TableName='treatment_arm_pending'
)
print("Table status:", table.table_status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment