Open lifeofguenter opened 6 years ago
Just curious, is this because you share AMI's across accounts and you want to operate from a single list or would just running tool twice across separate accounts be doable?
Yes, AMIs are shared across accounts so they can be managed centrally and independent.
Running the script multiple times would not help because I'd still have to somehow create a cross-check if an AMI-id is still being used.
E.g. I can not delete the AMI from SOURCE if DEST-A or DEST-B are still using it.
I created already a simple tool in PHP that will do that: https://github.com/NINEJKH/mamicleaner - e.g. it accepts multiple -p
(= profile) args and will only delete images that are not being used in either of the profiles.
The first -p
value assumes the SOURCE.
a cross check over multiple accounts would be great, maybe by allowing to specify multiple profile-names via cli-arg and then looping through those.
the region can be static as those ami's would be copies anyways?