diff --git a/aws/ami.go b/aws/ami.go index 12cda9f7..d9465297 100644 --- a/aws/ami.go +++ b/aws/ami.go @@ -50,6 +50,7 @@ func nukeAllAMIs(session *session.Session, imageIds []*string) error { logging.Logger.Infof("Deleting all AMIs in region %s", *session.Config.Region) + deletedCount := 0 for _, imageID := range imageIds { params := &ec2.DeregisterImageInput{ ImageId: imageID, @@ -59,10 +60,11 @@ func nukeAllAMIs(session *session.Session, imageIds []*string) error { if err != nil { logging.Logger.Errorf("[Failed] %s", err) } else { + deletedCount++ logging.Logger.Infof("Deleted AMI: %s", *imageID) } } - logging.Logger.Infof("[OK] %d AMI(s) terminated in %s", len(imageIds), *session.Config.Region) + logging.Logger.Infof("[OK] %d AMI(s) terminated in %s", deletedCount, *session.Config.Region) return nil }