Search in sources :

Example 1 with RequestLaunchTemplateData

use of com.amazonaws.services.ec2.model.RequestLaunchTemplateData in project cloudbreak by hortonworks.

the class AwsLaunchTemplateUpdateService method getCreateLaunchTemplateVersionRequest.

private CreateLaunchTemplateVersionResult getCreateLaunchTemplateVersionRequest(AmazonEc2Client ec2Client, Map<LaunchTemplateField, String> updatableFields, LaunchTemplateSpecification launchTemplateSpecification) {
    CreateLaunchTemplateVersionRequest createLaunchTemplateVersionRequest = new CreateLaunchTemplateVersionRequest().withLaunchTemplateId(launchTemplateSpecification.getLaunchTemplateId()).withSourceVersion(launchTemplateSpecification.getVersion()).withVersionDescription(updatableFields.getOrDefault(LaunchTemplateField.DESCRIPTION, null)).withLaunchTemplateData(new RequestLaunchTemplateData().withImageId(updatableFields.getOrDefault(LaunchTemplateField.IMAGE_ID, null)).withUserData(updatableFields.getOrDefault(LaunchTemplateField.USER_DATA, null)));
    CreateLaunchTemplateVersionResult createLaunchTemplateVersionResult = ec2Client.createLaunchTemplateVersion(createLaunchTemplateVersionRequest);
    validateCreatedLaunchTemplateVersionResult(createLaunchTemplateVersionResult);
    LOGGER.debug("Updated field in new launch template version: {}", updatableFields);
    return createLaunchTemplateVersionResult;
}
Also used : CreateLaunchTemplateVersionResult(com.amazonaws.services.ec2.model.CreateLaunchTemplateVersionResult) RequestLaunchTemplateData(com.amazonaws.services.ec2.model.RequestLaunchTemplateData) CreateLaunchTemplateVersionRequest(com.amazonaws.services.ec2.model.CreateLaunchTemplateVersionRequest)

Aggregations

CreateLaunchTemplateVersionRequest (com.amazonaws.services.ec2.model.CreateLaunchTemplateVersionRequest)1 CreateLaunchTemplateVersionResult (com.amazonaws.services.ec2.model.CreateLaunchTemplateVersionResult)1 RequestLaunchTemplateData (com.amazonaws.services.ec2.model.RequestLaunchTemplateData)1