博托:帮帮我,我收到了这个错误

时间:2016-08-21 14:09:27

标签: python amazon-web-services amazon-ec2 boto3

import boto3
 >>> client = boto3.client('ec2')
     >>> response = client.create_tags(DryRun = True | False, Resources = ['ABC', ], Tags = [{
                'Key' : 'vennkata',
                'Value' : 'ratnam'
            }, ])
    Traceback(most recent call last) :
    File "<stdin>", line 1, in < module >
File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 159, in _api_call
return self._make_api_call(operation_name, kwargs)

botocore.exceptions.EndpointConnectionError : Could not connect to the endpoint URL : "https://ec2.us-west.amazonaws.com/"

任何人都可以提供建议,以便在使用卷ID创建快照时避免此错误吗?

1 个答案:

答案 0 :(得分:4)

无法连接到端点网址:https://ec2 us-west .amazonaws.com

us-west不是有效区域。目前支持的区域为us-west-1us-west-2。请参阅 AWS Regions and Endpoints - Amazon Web Services您必须错误配置该区域。检查〜/ .aws / config 并修复它或在shell中设置正确的值。

export AWS_DEFAULT_REGION=us-west-1