String asGroupName = cfStackUtil.getAutoscalingGroupName(stack);
DetachInstancesRequest detachInstancesRequest = new DetachInstancesRequest().withAutoScalingGroupName(asGroupName).withInstanceIds(instanceIds)
.withShouldDecrementDesiredCapacity(true);
amazonASClient.detachInstances(detachInstancesRequest);
amazonEC2Client.terminateInstances(new TerminateInstancesRequest().withInstanceIds(instanceIds));
LOGGER.info("Terminated instances in stack '{}': '{}'", stack.getId(), instanceIds);
LOGGER.info("Publishing {} event [StackId: '{}']", ReactorConfig.STACK_UPDATE_SUCCESS_EVENT, stack.getId());
reactor.notify(ReactorConfig.STACK_UPDATE_SUCCESS_EVENT, Event.wrap(new StackUpdateSuccess(stack.getId(), true, instanceIds)));
return true;
}