Skip to content

How can I find the OS platform or version that my EC2 Windows instance is using?

0

Environment in AWS GovCloud space. Trying to get the Platform Detail to show, but not working. Using this command in powershell:

aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId, Platform, PlatformDetails]' --output table

It just says instance-id, windows, windows. Would like for it to say instance-id, windows, Microsoft Windows Server 2016 Datacenter.

Also tried aws cli via command prompt, but no output for this: aws ssm describe-instance-information --query 'InstanceInformationList[*].[InstanceId,PlatformType,PlatformName]' --output table --region us-gov-west-1

1 Answer
0

To find the specific OS platform or version of your EC2 Windows instance in the AWS GovCloud environment, you have a few options:

  1. Using EC2 Instance Metadata: You can access the instance metadata from within the EC2 instance itself. Connect to your instance using Remote Desktop Protocol (RDP), open PowerShell, and run the following command:

    Invoke-RestMethod -Uri http://169.254.169.254/latest/meta-data/platform-details

    This should provide you with the detailed platform information you're looking for.

  2. Using Systems Manager: If you're having trouble with the AWS CLI command for Systems Manager, ensure that:

    • The AWS Systems Manager agent is installed and running on your instance.
    • Your instance has the necessary IAM permissions to communicate with Systems Manager.
    • The correct region is specified (which you've done with --region us-gov-west-1).

    If these are all set up correctly, try running the command again. If it still doesn't work, you may need to troubleshoot your Systems Manager setup.

  3. Using the EC2 Console: The new EC2 console experience, which is now available in AWS GovCloud (US) Regions, provides an easier way to view instance details. You can navigate to the EC2 dashboard, select your instance, and view its details in the console. This should display the platform details you're looking for.

  4. Alternative AWS CLI Command: If the describe-instances command isn't providing the detail you need, you could try:

    aws ec2 describe-instances --instance-ids your-instance-id --query 'Reservations[].Instances[].PlatformDetails' --output text --region us-gov-west-1

    Replace 'your-instance-id' with your actual instance ID.

If you're still unable to retrieve the detailed platform information, it's possible that there might be an issue with how the AMI was created or how the instance was launched. In this case, you may need to contact AWS support for further assistance.

Remember, the exact output (like "Microsoft Windows Server 2016 Datacenter") depends on the specific Windows version installed on your instance.
Sources
Access instance metadata for an EC2 instance - Amazon Elastic Compute Cloud
New EC2 console instance launch experience available in the AWS GovCloud (US) Regions

answered 9 months ago
EXPERT
reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.