Created
June 24, 2015 14:18
-
-
Save linusthe3rd/ff3a0d28848e19626056 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 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