在 Windows 2012 中的 powershell 中运行 AWS 命令​​时出现连接错误

在 Windows 2012 中的 powershell 中运行 AWS 命令​​时出现连接错误

我们已经安装了以下版本的 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 <>

相关内容