AwsCredential credential = (AwsCredential) stack.getCredential();
AmazonAutoScalingClient amazonASClient = awsStackUtil.createAutoScalingClient(region, credential);
AmazonEC2Client amazonEC2Client = awsStackUtil.createEC2Client(region, credential);
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());