How to retrieve EC2 internal IP using Tags?

Hey ,

I want to retrieve internal IP / hostname of EC2 machine which hase some tags.
How can i retrieve based on tags?

I was reading this : docs.ansible.com/intro_dynamic_inventory.html#example-aws-ec2-external-inventory-script./ , but this requires “host” argument , which i do not want to use.

Thanks,
Pradeep