(https://github.com/mwilliamson/jq.py)
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="Name")|select(.Value=="InstanceName")) | [ .PublicIpAddress]'
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="Name")|select(.Value=="InstanceName")) | [ .PublicIpAddress, (.Tags[]|select(.Key=="Name").Value)]'
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.KeyName == "MyKey") | select(.State.Code != 48) | select(.Tags[]|select(.Key=="InventoryGroup").Value) | [ .PublicIpAddress, (.Tags[]|select(.Key=="Name").Value)]'