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

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

Introduction

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

Prototype


public Integer getMinSize() 

Source Link

Document

The minimum size of the group.

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);
}