I'm using the boto
library in Python to connect to DynamoDB. The following code has been working for me just fine:
import boto
key = 'abc'
secret = '123'
con = boto.connect_dynamodb(key,secret)
table = con.get_table('Table Name')
-- rest of code --
When I try to connect to a specific region, I can connect just fine, but getting the table to work on is throwing an error:
import boto
from boto.ec2.connection import EC2Connection
key = 'abc'
secret = '123'
regions = EC2Connection(key,secret).get_all_regions() # some filtering after this line to remove unwanted entries
for r in regions:
con = boto.connect_dynamodb(key,secret,region=r)
table = con.get_table('Table Name') # throws the error below
-- rest of code --
Using the second block of code above, I get a ValueError: No JSON object could be decoded
. Calling con.list_tables()
shows the table I'm looking for in the first code block, but throws the same error when I try it in the second code block. Can anyone help me out?