public void run() throws IOException {
        List<Stack> stacks = opsworksUtil.getStacksByName(stackName);
        if (stacks.isEmpty()) {
            throw new IllegalArgumentException("No stack found with name '" + stackName + "'");
        }

        for (Stack stack : stacks) {
            List<App> apps = opsworksUtil.getAppsByName(stack.getStackId(), appName);
            if (apps.isEmpty()) {
                throw new IllegalArgumentException("No app found with name '" + appName + "'");
            }
            for (App app : apps) {
                DeleteAppRequest request = new DeleteAppRequest();
                request.setAppId(app.getAppId());
                opsworks.deleteApp(request);
            }
        }
    }