EC2
- filter search
Below will find "web1", "web41", "web444" instances which have that tag "Name".
tag:Name : ^web[0-9]*
CloudWatch
- decrypt CloudWatch Logs Message Event
- https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchlogs.html
cat event.json | jq -r .awslogs.data | base64 -D | gzip -d | jq .
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