Skip to main content
chandrasekar97

7 days ago

Instance metadata in windows OS

Hi ,


Please tell how to view the instance meta data using windows operating system. and please confirm is there any document available for connecting EC2 instance via putty.

Image of
5 days ago
Hello,

The instance metadata can be retrieved from any operating system using HTTP via the 169.254.169.254 address. (IMDS).

All of the examples you'll see are through Linux mostly, because of the common CURL tool that is included. But you could also retrieve the info in the same way from Windows using any tool that can interact with HTTP.

With Windows, I'd say the best option is through PowerShell. Specifically the Invoke-RestMethod command, which can be used for the EC2 IMDS (or any HTTP API, for that matter).

AWS documentation: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instancedata-data-retrieval.html

You could also use the the AWS PowerShell tools. If you have these installed, you could then use the dedicated AWS PowerShell commands like in this article: https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceMetadata.html

The EC2 instance metadata service is intentionally OS agnostic, which means you can use any tool that works with HTTP. For example, you might even have a Python app in your EC2 instance that uses the requests HTTP library instead. Whatever suits your situation.

Hope this helps!
Image of
4 days ago
Hello again,

Apologies, I see I missed part of your question - connecting to Windows by PuTTY.

This isn't something that AWS would document. Because Windows doesn't natively run an SSH server, for you to connect to using PuTTY.

It is possible, but unless there is a need to do so, you can just use RDP. RDP is the Microsoft equivalent to SSH (kind of), and allows you to remotely manage Windows PC's.

Thanks
James