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

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

Introduction

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

Prototype


public String getVPCZoneIdentifier() 

Source Link

Document

A comma-separated list of subnet IDs for your virtual private cloud (VPC).

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