我可以使用 URL 从 AWS EC2 windows 机器的 IE 浏览器获取实例 IDhttp://169.254.169.254/latest/meta-data/instance-id
当我使用 Powershell 命令时在同一台机器上
Invoke-WebRequest http://169.254.169.254/latest/meta-data/instance-id
然后我得到以下错误
Invoke-WebRequest : Network Error (tcp_error) A communication error occurred: "Operation timed out" The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time. For assistance, contact your network support team. At line:1 char:1
+ Invoke-WebRequest http://169.254.169.254/latest/meta-data/instance-id
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
注意:Invoke-WebRequest http://google.com
正在工作并从 PowerShell cmd 给出响应。
请任何人澄清这个错误是什么。