AWS ELB IP grep and update the inventory for the respective domain

I am trying to grep the IP available on the AWS ELB (nodes attached to it) and then doing some operation on it.

Now, the issue is how can I on the fly update the ansible inventory of the new available IP, so that next operation will read the IP from the inventory and will further execute the next step.

Moreover, I have multiple domains registered in ansible inventory.

E.g. In inventory file I have abc.com & xyz.com and the IP which grep from the respective ELB should update the only respective domain.

or any other way round if you could advise.