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

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

Introduction

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

Prototype


public void setMaxSize(Integer maxSize) 

Source Link

Document

The maximum size of the group.

Usage

From source file:com.pinterest.clusterservice.cm.AwsVmManager.java

License:Apache License

private void createAutoScalingGroup(String clusterName, AwsVmBean bean) throws Exception {
    try {//from  w  w  w . j ava  2 s .  c o  m
        CreateAutoScalingGroupRequest asgRequest = new CreateAutoScalingGroupRequest();
        asgRequest.setAutoScalingGroupName(clusterName);
        asgRequest.setLaunchConfigurationName(bean.getLaunchConfigId());
        asgRequest.setVPCZoneIdentifier(bean.getSubnet());
        asgRequest.setMinSize(bean.getMinSize());
        asgRequest.setMaxSize(bean.getMaxSize());
        aasClient.createAutoScalingGroup(asgRequest);
    } catch (AmazonClientException e) {
        LOG.error(String.format("Failed to create auto scaling group %s: %s", clusterName, e.getMessage()));
        throw new Exception(
                String.format("Failed to create auto scaling group %s: %s", clusterName, e.getMessage()));
    }
}