Get Public IP Address on current EC2 Instance

后端 未结 6 852
感动是毒
感动是毒 2020-12-07 16:35

Using Amazon CLI, is there a way to get the public ip address of the current EC2? I\'m just looking for the single string value, so not the json response describe-addresses

6条回答
  •  一向
    一向 (楼主)
    2020-12-07 17:06

    Get attached InstanceID with PublicIP.

    aws ec2 describe-network-interfaces --query NetworkInterfaces[*].[Attachment.[InstanceId],Association.[PublicIp]] --output=json
    

提交回复
热议问题