Last active
October 26, 2017 20:13
-
-
Save asampatoor/d3955551d667fe02f5a7fe53b156e5d5 to your computer and use it in GitHub Desktop.
This file contains 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
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