Skip to content

Instantly share code, notes, and snippets.

@cromyhector
Created June 19, 2022 07:29
Show Gist options
  • Save cromyhector/f43a48b058c5b393a81aadf93490b138 to your computer and use it in GitHub Desktop.
Save cromyhector/f43a48b058c5b393a81aadf93490b138 to your computer and use it in GitHub Desktop.
import boto3
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.create_table(
TableName='LUDreamCar',
KeySchema=[
{
'AttributeName': 'brand',
'KeyType': 'HASH' #Partition key
},
{
'AttributeName': 'model',
'KeyType': 'RANGE' #Sort key
}
],
AttributeDefinitions=[
{
'AttributeName': 'brand',
'AttributeType': 'S'
},
{
'AttributeName': 'model',
'AttributeType': 'S'
},
],
ProvisionedThroughput={
'ReadCapacityUnits': 10,
'WriteCapacityUnits': 10
}
)
print("Table status:", table.table_status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment