我们有一个通过VPC端点连接到Amazon S3的Python客户端.我们的代码使用boto,我们可以从S3连接和下载.
从boto迁移到boto3后,我们注意到VPC端点连接不再有效.下面是一个可以重现问题的副本片段.
python -c "import boto3;s3 = boto3.resource('s3',aws_access_key_id='foo',aws_secret_access_key='bar');s3.Bucket('some-bucket').download_file('hello-remote.txt', 'hello-local.txt')"
Run Code Online (Sandbox Code Playgroud)
得到以下错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python27\lib\site-packages\boto3-1.4.0-py2.7.egg\boto3\s3\inject.py",
line 163, in bucket_download_file
ExtraArgs=ExtraArgs, Callback=Callback, Config=Config)
File "C:\Python27\lib\site-packages\boto3-1.4.0-py2.7.egg\boto3\s3\inject.py",
line 125, in download_file
extra_args=ExtraArgs, callback=Callback)
File "C:\Python27\lib\site-packages\boto3-1.4.0-py2.7.egg\boto3\s3\transfer.py
", line 269, in download_file
future.result()
File "build\bdist.win32\egg\s3transfer\futures.py", line 73, in result
File "build\bdist.win32\egg\s3transfer\futures.py", line 233, in result
botocore.vendored.requests.exceptions.ConnectionError: ('Connection aborted.', e
rror(10060, 'A connection attempt failed because the connected party did not pro
perly respond after a period …Run Code Online (Sandbox Code Playgroud)