Edited at

aws


EC2


  • filter search

Below will find "web1", "web41", "web444" instances which have that tag "Name".

tag:Name : ^web[0-9]*


scripts


  • get specific EIP's Name

ips=(

xx.xx.xx.xx
yy.yy.yy.yy
)

for ip in ${ips[@]}
do
echo -ne "$ip\t"
echo $(aws ec2 describe-addresses --filters "Name=public-ip,Values=${ip}" | jq '.Addresses[].Tags[] | select(."Key" == "Name").Value ')
done