Created
January 21, 2012 02:44
-
-
Save arfon/1650927 to your computer and use it in GitHub Desktop.
AWS DynamoDB table creation (simple primary_key)
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
require 'aws-sdk' | |
AWS_ACCESS_KEY = 'your_aws_access_key' | |
AWS_SECRET_KEY = 'your_aws_secret_key' | |
dynamo_db = AWS::DynamoDB.new(:access_key_id => AWS_ACCESS_KEY, :secret_access_key => AWS_SECRET_KEY) | |
# create a table (50 read and 50 write capacity units) | |
# create primary key index using hash_key (:id) | |
table = dynamo_db.tables.create("tweets", 50, 50, | |
:hash_key => { :id => :number } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment