class AwsTerminateService {

    public List<CloudResourceStatus> terminate(AuthenticatedContext ac, CloudStack stack, List<CloudResource> resources) {
        LOGGER.debug("Deleting stack: {}", ac.getCloudContext().getId());
        AwsCredentialView credentialView = new AwsCredentialView(ac.getCloudCredential());
        AuthenticatedContextView authenticatedContextView = new AuthenticatedContextView(ac);
        String regionName = authenticatedContextView.getRegion();
        AmazonEC2Client amazonEC2Client = authenticatedContextView.getAmazonEC2Client();
        AmazonCloudFormationClient amazonCloudFormationClient = awsClient.createCloudFormationClient(credentialView, regionName);

        awsCloudWatchService.deleteCloudWatchAlarmsForSystemFailures(stack, regionName, credentialView);
        waitAndDeleteCloudformationStack(ac, stack, resources, amazonCloudFormationClient);
        awsComputeResourceService.deleteComputeResources(ac, stack, resources);
        cleanupEncryptedResources(ac, resources, regionName, amazonEC2Client);
        deleteKeyPair(ac, stack, amazonEC2Client, credentialView, regionName);
        deleteLaunchConfiguration(resources, ac);
        LOGGER.debug("Deleting stack finished");
        return awsResourceConnector.check(ac, resources);
    }

}