![在 Windows 2012 中的 powershell 中运行 AWS 命令时出现连接错误](https://linux22.com/image/688600/%E5%9C%A8%20Windows%202012%20%E4%B8%AD%E7%9A%84%20powershell%20%E4%B8%AD%E8%BF%90%E8%A1%8C%20AWS%20%E5%91%BD%E4%BB%A4%E2%80%8B%E2%80%8B%E6%97%B6%E5%87%BA%E7%8E%B0%E8%BF%9E%E6%8E%A5%E9%94%99%E8%AF%AF.png)
我们已经安装了以下版本的 AWS powershell 工具。当我们尝试运行 AWS 命令时,我们收到如下所示的连接错误:
---- AWS Powershell version---
PS C:\Users> Get-AWSPowerShellVersion
AWS Tools for Windows PowerShell
Version 2.3.8.1
Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Amazon Web Services SDK for .NET
Version 2.3.8.1
Copyright 2009-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
--- PSVersion 4.0 ------
。
--- Error ---
ConnectionError: ('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not p
roperly respond after a period of time or established connection failed because connected host has failed to respond'))
2016-08-23 09:43:30,944 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255
('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not properly respond a
fter a period of time or established connection failed because connected host has failed to respond'))
PS C:\Users> curl http://ec2.eu-central-1.amazonaws.com
curl : Unable to connect to the remote server
At line:1 char:1
+ curl http://ec2.eu-central-1.amazonaws.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
端口 80 和 443 在 SG 中已正确打开。尝试在机器中导出/不导出代理。
答案1
问题已解决。我们将 AWS powershell 版本升级到 3.1.95.0。已安装 AWSToolsAndSDKForNet_sdk-3.1.95.0_ps-3.1.95.0_tk-1.10.0.2。使用以下方法设置代理:Set-AWSProxy -Hostname <> -Port <>