Python boto us-gov-west-1地区

Python boto us-gov-west-1地区,python,amazon-web-services,boto,Python,Amazon Web Services,Boto,我尝试使用以下代码列出帐户中的所有实例: for region in boto.ec2.regions(**creds): print region.name ec2_conn = boto.ec2.connect_to_region(region.name, **creds) for instance in ec2_conn.get_only_instances(): print instance 但在检查区域“us-gov-west-1”时失败,错

我尝试使用以下代码列出帐户中的所有实例:

for region in boto.ec2.regions(**creds):
    print region.name
    ec2_conn = boto.ec2.connect_to_region(region.name, **creds)

    for instance in ec2_conn.get_only_instances():
        print instance
但在检查区域“us-gov-west-1”时失败,错误为:

boto.exception.EC2ResponseError:EC2ResponseError:401未经授权 AuthFailureAWS无法验证提供的访问凭证C873C473-c3b1-4be3-b562-b2e73b21e9c2

据我所知,该地区是一些特殊的政府区域,不允许我使用。但怎么能忽视它呢?我可以用
来包装我的循环,试试。。。除了
,但是否有办法获取仅可访问区域的列表

UPD:在使用以下代码遍历区域时:

ec2_conn = boto.ec2.connection.EC2Connection(**creds)
for region in ec2_conn.get_all_regions():
没有给出“us-gov-west-1”区域。但为什么这种方法会产生不同的结果,以及何时应该使用每种方法

找到了

提供所有现有区域的列表,这些区域在库中硬编码,以及

是否实际调用以获取当前可用区域的列表

正如有人所说:读卢克的资料

找到了

提供所有现有区域的列表,这些区域在库中硬编码,以及

是否实际调用以获取当前可用区域的列表


正如有人所说:读卢克的资料

此外,我认为您需要单独的凭据,或者至少需要为GovCloud明确授权的凭据。此外,我认为您需要单独的凭据,或者至少需要为GovCloud明确授权的凭据。