我有Windows EC2并尝试获取元数据
Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/
Invoke-RestMethod : Unable to connect to the remote server
At line:1 char:1
+ Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
如何查看EC2实例的元数据?
答案 0 :(得分:0)
在EC2实例上运行InitializeInstance.ps1
修复了问题