首页 > 解决方案 > Boto3 EndpointConnectionError:无法连接到端点(以前工作正常)

问题描述

我升级到boto3几个月前。这些操作总是用来正常工作的。据我所知,没有任何改变,但最近当我尝试访问aws服务器时出现了这个错误。

client = boto3.client(
        'mturk',
        aws_access_key_id = key,
        aws_secret_access_key = secret_key,
        endpoint_url= r"https://mturk-requester.us-east-1.amazonaws.com/")

client.get_hit(HITId=hit.id)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL:
"https://mturk-requester.us-east-1.amazonaws.com/"

现在,在发布命中、检查余额等时会发生这种情况。所有这些操作最初都按预期工作。

awscli的配置为

[default]
region=us-east-1 

标签: amazon-web-servicesboto3aws-climechanicalturk

解决方案


对我来说似乎工作得很好:

client = boto3.client('mturk',region_name='us-east-1')

推荐阅读