class LaunchConfigurationHandler {

    public List<LaunchConfiguration> getLaunchConfigurations(AmazonAutoScalingClient autoScalingClient, Collection<AutoScalingGroup> scalingGroups) {
        DescribeLaunchConfigurationsRequest launchConfigurationsRequest = new DescribeLaunchConfigurationsRequest();
        launchConfigurationsRequest.setLaunchConfigurationNames(
                scalingGroups.stream().map(AutoScalingGroup::getLaunchConfigurationName).collect(Collectors.toList()));
        return autoScalingClient.describeLaunchConfigurations(launchConfigurationsRequest).getLaunchConfigurations();
    }

}