We assigned VM(s) with tag(soft_retire), retirement date and retirement warn(14) while deploying.
In first step when vm_retire_warn event is triggered 14 days before vm retires , we are sending out email and resetting retirement warn days. Please refer below link for warning emails.
Similarly, when request_vm_retire event is triggered, based on tag(soft_retire) we are unassgning tag(soft_retire) and assigning tag(full_retire), resetting retirement date and powering off the vm. So, next time when it is triggered based on tag(full_retire) we are removing the vm completely.
Hope this helps, let me know if you have any questions.