def delete(self): if not self.exists(): return if len(self.instances) > 0: raise Exception("Can not delete %s with %d active instances" % (self.debug_str(), len(self.instances))) Cluster.delete_autoscale_group(self.gname) Cluster.delete_launch_config(self.gname) Cluster.delete_placement_group(self.gname)