I am trying to write a python
script that terminates a spot fleet.
The boto3
API call cancel_spot_fleet_requests()
conveniently provides TerminateInstances
flag, that terminates all the instances.
Now I would also like to delete the spot volumes. I can do it in my script using boto3
's delete_volume()
. The problem is that I must wait until the instances fully terminate, and it takes too much time.
Ideally I would like to mark the volume for deletion when the instance terminates, and have AWS do it in the background.
Is that possible? Is there an XY alternative? (my goal is to delete the volumes without having to wait long time in my script until the instances terminate).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…