Example usage for com.amazonaws.services.autoscaling.model CreateAutoScalingGroupRequest getLaunchConfigurationName

List of usage examples for com.amazonaws.services.autoscaling.model CreateAutoScalingGroupRequest getLaunchConfigurationName

Introduction

In this page you can find the example usage for com.amazonaws.services.autoscaling.model CreateAutoScalingGroupRequest getLaunchConfigurationName.

Prototype


public String getLaunchConfigurationName() 

Source Link

Document

The name of the launch configuration.

Usage

From source file:web.component.impl.aws.AWSAutoScalingImpl.java

@Override
public void createAutoScalingGroup(CreateAutoScalingGroupRequest request) {

    if (request.getAutoScalingGroupName() == null || request.getAutoScalingGroupName().isEmpty())
        throw new IllegalArgumentException("Auto scaling group name not specified.");
    if (request.getMaxSize() == null)
        throw new IllegalArgumentException("Max size not specified.");
    if (request.getMinSize() == null)
        throw new IllegalArgumentException("Min size not specified.");
    if ((request.getLaunchConfigurationName() == null || request.getLaunchConfigurationName().isEmpty())
            && (request.getInstanceId() == null || request.getInstanceId().isEmpty()))
        throw new IllegalArgumentException(
                "Either launch configuration name or instance ID must be specified.");
    if ((request.getLaunchConfigurationName() != null && !request.getLaunchConfigurationName().isEmpty())
            && (request.getInstanceId() != null && !request.getInstanceId().isEmpty()))
        throw new IllegalArgumentException(
                "Either launch configuration name or instance ID must be specified.");
    if ((request.getAvailabilityZones() == null || request.getAvailabilityZones().isEmpty())
            && request.getVPCZoneIdentifier() == null)
        throw new IllegalArgumentException("At least one availability zone or VPC subnet must be specified.");

    awsHttpClient.createAutoScalingGroup(request);
}