Get Public IP Address on current EC2 Instance

后端 未结 6 855
感动是毒
感动是毒 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:15

    This command also will display your instance Public IP address:

    curl -s ifconfig.co
    

提交回复
热议问题