amazon web services - Aws public ip in runing instance -


when ifconfig in ec2 instance private ip. adding sites-available in apache need public ip.

is there way can public ip in running instance.

there "magic ip" on amazon ec2 instaces can curl metadata instance.

to public ip of current instance can do:

curl http://169.254.169.254/latest/meta-data/public-ipv4 

you can read full documentation here.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -