/** * Describe a set of specific launch configurations. * * @param names the launch configuration names * @return the launch configurations */ public List<LaunchConfiguration> describeLaunchConfigurations(String... names) { if (names == null || names.length == 0) { LOGGER.info("Getting all launch configurations."); } else { LOGGER.info(String.format("Getting launch configurations for %d names.", names.length)); } List<LaunchConfiguration> lcs = new LinkedList<LaunchConfiguration>(); AmazonAutoScalingClient asgClient = asgClient(); DescribeLaunchConfigurationsRequest request = new DescribeLaunchConfigurationsRequest().withLaunchConfigurationNames(names); DescribeLaunchConfigurationsResult result = asgClient.describeLaunchConfigurations(request); lcs.addAll(result.getLaunchConfigurations()); while (result.getNextToken() != null) { request.setNextToken(result.getNextToken()); result = asgClient.describeLaunchConfigurations(request); lcs.addAll(result.getLaunchConfigurations()); } LOGGER.info(String.format("Got %d launch configurations.", lcs.size())); return lcs; }