We can use the get_driver()
function on the Provider.EC2
object. The list_regions()
method will give you the list of acceptable values to pass when connecting to a region. list_regions
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
driver = get_driver(Provider.EC2)
driver.list_regions()
['ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'cn-north-1', 'cn-northwest-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1', 'us-east-1', 'us-east-2', 'us-gov-west-1', 'us-west-1', 'us-west-2']