Wednesday, Sep 6th, 2017
Want the list of all Public IP addresses associated with your Amazon Web Services account? Install aws-cli, configure, then:
aws ec2 describe-network-interfaces --query NetworkInterfaces[].Association.PublicIp
The result is a JSON array, so you can sort numerically with jq
:
aws ec2 describe-network-interfaces --query NetworkInterfaces[].Association.PublicIp | jq 'sort_by(.)'
Comments
Mark replied on Permalink
Hey, just came across this, exactly what I was looking for but I can't copy the command.