ansible jinja template how can I get ip varible of aws instances

I have 3 nodes neo4j databases ( all in AWS). I need to create config with jinja templates (neo4j-server.properties.j2) with diferent ip addr in option “elasticsearch.host_name=”
How can I add to this config ip varible of 3 different internal ip from elastic search nodes which also in AWS ,