The problem with the above code is that the get_all_regions()
call from the EC2 module returns a list of RegionInfo
objects consisting of a region name and a region endpoint. But the endpoint is for the EC2 service, not SQS. So, if you pass that RegionInfo
into the SQSConnection
constructor it will end up trying to make SQS requests against an EC2 endpoint which results in the NoSuchVersion
error.
Here's how I would do this:
import boto.sqs
sqs = boto.sqs.connect_to_region('eu-west-1')
sqs.get_all_queues()
Similarly, if you need an EC2 connection:
import boto.ec2
ec2 = boto.ec2.connect_to_region('eu-west-1')