How to find OS of an EC2 instance using AWS CLI

后端 未结 4 824
鱼传尺愫
鱼传尺愫 2020-12-10 07:49

How can you find out the OS running on an EC2 instance using AWS CLI.

The ec2 describe-instance command spits out a lot of information , but there is n

4条回答
  •  天涯浪人
    2020-12-10 08:22

    Try this command:

    aws ec2 describe-images --image-ids $(aws ec2 describe-instances --instance-ids i-xxxxxxxxxxxxx --query 'Reservations[0].Instances[0].ImageId' --output text) --query 'Images[0].Name'
    

    $() part gets the ImageId using InstanceId.

提交回复
热议问题