class LaunchConfigurationHandler {

    public String createNewLaunchConfiguration(String imageName, AmazonAutoScalingClient autoScalingClient,
            LaunchConfiguration oldLaunchConfiguration, CloudContext cloudContext, String encryptedImageName) {
        String selectedImageName = StringUtils.isBlank(encryptedImageName) ? imageName : encryptedImageName;
        CreateLaunchConfigurationRequest createLaunchConfigurationRequest = getCreateLaunchConfigurationRequest(selectedImageName, oldLaunchConfiguration);
        LOGGER.debug("Create LaunchConfiguration {} with image {}",
                createLaunchConfigurationRequest.getLaunchConfigurationName(), selectedImageName);
        autoScalingClient.createLaunchConfiguration(createLaunchConfigurationRequest);
        CloudResource cloudResource = CloudResource.builder()
                .type(ResourceType.AWS_LAUNCHCONFIGURATION)
                .params(Collections.emptyMap())
                .name(createLaunchConfigurationRequest.getLaunchConfigurationName())
                .build();
        resourceNotifier.notifyAllocation(cloudResource, cloudContext);
        return createLaunchConfigurationRequest.getLaunchConfigurationName();
    }

}