在给定实例ID的情况下检索EC2实例的IP地址

问题描述 投票:4回答:3

使用aws CLI,如何在给定其instanceID的情况下检索EC2实例的私有IP地址?

当我做:

aws ec2 describe-instance-status --instance-ids <instance_ID>

我得到其他信息,但不是私有IP地址,例如:

{
    "InstanceStatuses": [
        {
            "InstanceId": "XXXXX", 
            "InstanceState": {
                "Code": 16, 
                "Name": "running"
            }, 
            "AvailabilityZone": "us-east-1a", 
            "SystemStatus": {
                "Status": "ok", 
                "Details": [
                    {
                        "Status": "passed", 
                        "Name": "reachability"
                    }
                ]
            }, 
            "InstanceStatus": {
                "Status": "ok", 
                "Details": [
                    {
                        "Status": "passed", 
                        "Name": "reachability"
                    }
                ]
            }
        }
    ]
}
amazon-web-services aws-cli
3个回答
© www.soinside.com 2019 - 2024. All rights reserved.