How do you manage your inventory of spot instances on AWS with Ansible I am new to Ansible, with some experience in Chef. I am considering learn and use Ansible to manage environments.

I was wondering, what would be the best practice to manage inventory of AWS spot instances?

For example, when a spot instance is shut down the old IP is not relevant anymore in the inventory of hosts.

Are there any other alternative approaches for the use case of elastic environments?
You are looking for Dynamic Inventory

Please look into ec2.py and ec2.ini of Ansible, and also the Dynamic Inventory docs of Ansible are very good for understanding how to manage your AWS inventory.