Forked from linusthe3rd/gist:ff3a0d28848e19626056
Last active
August 29, 2015 14:23
-
-
Save jsocol/5d523508410b011d4bc9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 boto.dynamodb2 import connect_to_region | |
from boto.provider import Provider | |
aws_settings_provider = Provider('aws') | |
def create_connection(): | |
aws_region = # get the AWS region of the EC2 instance | |
# connect_to_region passes along the named arguments | |
# to the DynamoDBConnection class that gets created | |
return connect_to_region( | |
aws_region, | |
provider=aws_settings_provider, | |
) | |
def get_item(key): | |
connection = create_connection() | |
# Perform DynamoDB operations... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment