Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
    * 
    * Licensed under the Apache License, Version 2.0 (the "License").
    * You may not use this file except in compliance with the License.
    * A copy of the License is located at
    * 
    *  http://aws.amazon.com/apache2.0
    * 
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  package com.amazonaws.services.autoscaling.model;
  
  
Container for the parameters to the CreateAutoScalingGroup operation.

Creates an Auto Scaling group with the specified name and attributes.

If you exceed your maximum limit of Auto Scaling groups, which by default is 20 per region, the call fails. For information about viewing and updating these limits, see DescribeAccountLimits.

For more information, see Auto Scaling Groups in the Auto Scaling Developer Guide .

  
  public class CreateAutoScalingGroupRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the group. This name must be unique within the scope of your AWS account.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

  
      private String autoScalingGroupName;

    
The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

  
      private String launchConfigurationName;

    
The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

  
      private String instanceId;

    
The minimum size of the group.
  
      private Integer minSize;

    
The maximum size of the group.
  
      private Integer maxSize;

    
The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.
  
      private Integer desiredCapacity;

    
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

 
     private Integer defaultCooldown;

    
One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.

Constraints:
Length: 1 -

 
One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String healthCheckType;

    
The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
     private Integer healthCheckGracePeriod;

    
The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String placementGroup;

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

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String vPCZoneIdentifier;

    
One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

 
The name of the group. This name must be unique within the scope of your AWS account.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the group. This name must be unique within the scope of your AWS account.
 
     public String getAutoScalingGroupName() {
         return ;
     }
    
    
The name of the group. This name must be unique within the scope of your AWS account.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
autoScalingGroupName The name of the group. This name must be unique within the scope of your AWS account.
 
     public void setAutoScalingGroupName(String autoScalingGroupName) {
         this. = autoScalingGroupName;
     }
    
    
The name of the group. This name must be unique within the scope of your AWS account.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
autoScalingGroupName The name of the group. This name must be unique within the scope of your AWS account.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withAutoScalingGroupName(String autoScalingGroupName) {
         this. = autoScalingGroupName;
         return this;
     }

    
The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.
 
     public String getLaunchConfigurationName() {
         return ;
     }
    
    
The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
launchConfigurationName The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.
 
     public void setLaunchConfigurationName(String launchConfigurationName) {
         this. = launchConfigurationName;
     }
    
    
The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
launchConfigurationName The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withLaunchConfigurationName(String launchConfigurationName) {
         this. = launchConfigurationName;
         return this;
     }

    
The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

 
     public String getInstanceId() {
         return ;
     }
    
    
The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceId The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

 
     public void setInstanceId(String instanceId) {
         this. = instanceId;
     }
    
    
The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceId The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group from an EC2 Instance in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withInstanceId(String instanceId) {
         this. = instanceId;
         return this;
     }

    
The minimum size of the group.

Returns:
The minimum size of the group.
 
     public Integer getMinSize() {
         return ;
     }
    
    
The minimum size of the group.

Parameters:
minSize The minimum size of the group.
 
     public void setMinSize(Integer minSize) {
         this. = minSize;
     }
    
    
The minimum size of the group.

Returns a reference to this object so that method calls can be chained together.

Parameters:
minSize The minimum size of the group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withMinSize(Integer minSize) {
         this. = minSize;
         return this;
     }

    
The maximum size of the group.

Returns:
The maximum size of the group.
 
     public Integer getMaxSize() {
         return ;
     }
    
    
The maximum size of the group.

Parameters:
maxSize The maximum size of the group.
 
     public void setMaxSize(Integer maxSize) {
         this. = maxSize;
     }
    
    
The maximum size of the group.

Returns a reference to this object so that method calls can be chained together.

Parameters:
maxSize The maximum size of the group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withMaxSize(Integer maxSize) {
         this. = maxSize;
         return this;
     }

    
The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

Returns:
The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.
 
     public Integer getDesiredCapacity() {
         return ;
     }
    
    
The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

Parameters:
desiredCapacity The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.
 
     public void setDesiredCapacity(Integer desiredCapacity) {
         this. = desiredCapacity;
     }
    
    
The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

Returns a reference to this object so that method calls can be chained together.

Parameters:
desiredCapacity The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withDesiredCapacity(Integer desiredCapacity) {
         this. = desiredCapacity;
         return this;
     }

    
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

Returns:
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

 
     public Integer getDefaultCooldown() {
         return ;
     }
    
    
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

Parameters:
defaultCooldown The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

 
     public void setDefaultCooldown(Integer defaultCooldown) {
         this. = defaultCooldown;
     }
    
    
The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
defaultCooldown The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withDefaultCooldown(Integer defaultCooldown) {
         this. = defaultCooldown;
         return this;
     }

    
One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.

Constraints:
Length: 1 -

Returns:
One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.
 
     public java.util.List<StringgetAvailabilityZones() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.

Constraints:
Length: 1 -

Parameters:
availabilityZones One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.
 
     public void setAvailabilityZones(java.util.Collection<StringavailabilityZones) {
         if (availabilityZones == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringavailabilityZonesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(availabilityZones.size());
         availabilityZonesCopy.addAll(availabilityZones);
         this. = availabilityZonesCopy;
     }
    
    
One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.

NOTE: This method appends the values to the existing list (if any). Use setAvailabilityZones(java.util.Collection) or withAvailabilityZones(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 -

Parameters:
availabilityZones One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withAvailabilityZones(String... availabilityZones) {
         if (getAvailabilityZones() == nullsetAvailabilityZones(new java.util.ArrayList<String>(availabilityZones.length));
         for (String value : availabilityZones) {
             getAvailabilityZones().add(value);
         }
         return this;
     }
    
    
One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 -

Parameters:
availabilityZones One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (availabilityZones == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringavailabilityZonesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(availabilityZones.size());
             availabilityZonesCopy.addAll(availabilityZones);
             this. = availabilityZonesCopy;
         }
 
         return this;
     }

    
One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
     public java.util.List<StringgetLoadBalancerNames() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

Parameters:
loadBalancerNames One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
     public void setLoadBalancerNames(java.util.Collection<StringloadBalancerNames) {
         if (loadBalancerNames == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringloadBalancerNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(loadBalancerNames.size());
         loadBalancerNamesCopy.addAll(loadBalancerNames);
         this. = loadBalancerNamesCopy;
     }
    
    
One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

NOTE: This method appends the values to the existing list (if any). Use setLoadBalancerNames(java.util.Collection) or withLoadBalancerNames(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
loadBalancerNames One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withLoadBalancerNames(String... loadBalancerNames) {
         if (getLoadBalancerNames() == nullsetLoadBalancerNames(new java.util.ArrayList<String>(loadBalancerNames.length));
         for (String value : loadBalancerNames) {
             getLoadBalancerNames().add(value);
         }
         return this;
     }
    
    
One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
loadBalancerNames One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (loadBalancerNames == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringloadBalancerNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(loadBalancerNames.size());
             loadBalancerNamesCopy.addAll(loadBalancerNames);
             this. = loadBalancerNamesCopy;
         }
 
         return this;
     }

    
The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

 
     public String getHealthCheckType() {
         return ;
     }
    
    
The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
healthCheckType The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

 
     public void setHealthCheckType(String healthCheckType) {
         this. = healthCheckType;
     }
    
    
The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
healthCheckType The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withHealthCheckType(String healthCheckType) {
         this. = healthCheckType;
         return this;
     }

    
The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
     public Integer getHealthCheckGracePeriod() {
         return ;
     }
    
    
The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

Parameters:
healthCheckGracePeriod The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

 
     public void setHealthCheckGracePeriod(Integer healthCheckGracePeriod) {
         this. = healthCheckGracePeriod;
     }
    
    
The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
healthCheckGracePeriod The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateAutoScalingGroupRequest withHealthCheckGracePeriod(Integer healthCheckGracePeriod) {
         this. = healthCheckGracePeriod;
         return this;
     }

    
The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.
 
     public String getPlacementGroup() {
         return ;
     }
    
    
The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
placementGroup The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.
 
     public void setPlacementGroup(String placementGroup) {
         this. = placementGroup;
     }
    
    
The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
placementGroup The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateAutoScalingGroupRequest withPlacementGroup(String placementGroup) {
        this. = placementGroup;
        return this;
    }

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

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

    public String getVPCZoneIdentifier() {
        return ;
    }
    
    
A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
vPCZoneIdentifier A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

    public void setVPCZoneIdentifier(String vPCZoneIdentifier) {
        this. = vPCZoneIdentifier;
    }
    
    
A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
vPCZoneIdentifier A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon Virtual Private Cloud in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateAutoScalingGroupRequest withVPCZoneIdentifier(String vPCZoneIdentifier) {
        this. = vPCZoneIdentifier;
        return this;
    }

    
One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

Parameters:
terminationPolicies One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

    public void setTerminationPolicies(java.util.Collection<StringterminationPolicies) {
        if (terminationPolicies == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringterminationPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(terminationPolicies.size());
        terminationPoliciesCopy.addAll(terminationPolicies);
        this. = terminationPoliciesCopy;
    }
    
    
One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

NOTE: This method appends the values to the existing list (if any). Use setTerminationPolicies(java.util.Collection) or withTerminationPolicies(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
terminationPolicies One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateAutoScalingGroupRequest withTerminationPolicies(String... terminationPolicies) {
        if (getTerminationPolicies() == nullsetTerminationPolicies(new java.util.ArrayList<String>(terminationPolicies.length));
        for (String value : terminationPolicies) {
            getTerminationPolicies().add(value);
        }
        return this;
    }
    
    
One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
terminationPolicies One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
        if (terminationPolicies == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringterminationPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(terminationPolicies.size());
            terminationPoliciesCopy.addAll(terminationPolicies);
            this. = terminationPoliciesCopy;
        }
        return this;
    }

    
The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

Returns:
The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

Parameters:
tags The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
tags The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateAutoScalingGroupRequest withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
tags The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=value, value=value, propagate=true or false. Value and propagate are optional parameters.

For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling Developer Guide.

Returns:
A reference to this updated object so that method calls can be chained together.
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAutoScalingGroupName() != nullsb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ",");
        if (getLaunchConfigurationName() != nullsb.append("LaunchConfigurationName: " + getLaunchConfigurationName() + ",");
        if (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getMinSize() != nullsb.append("MinSize: " + getMinSize() + ",");
        if (getMaxSize() != nullsb.append("MaxSize: " + getMaxSize() + ",");
        if (getDesiredCapacity() != nullsb.append("DesiredCapacity: " + getDesiredCapacity() + ",");
        if (getDefaultCooldown() != nullsb.append("DefaultCooldown: " + getDefaultCooldown() + ",");
        if (getAvailabilityZones() != nullsb.append("AvailabilityZones: " + getAvailabilityZones() + ",");
        if (getLoadBalancerNames() != nullsb.append("LoadBalancerNames: " + getLoadBalancerNames() + ",");
        if (getHealthCheckType() != nullsb.append("HealthCheckType: " + getHealthCheckType() + ",");
        if (getHealthCheckGracePeriod() != nullsb.append("HealthCheckGracePeriod: " + getHealthCheckGracePeriod() + ",");
        if (getPlacementGroup() != nullsb.append("PlacementGroup: " + getPlacementGroup() + ",");
        if (getVPCZoneIdentifier() != nullsb.append("VPCZoneIdentifier: " + getVPCZoneIdentifier() + ",");
        if (getTerminationPolicies() != nullsb.append("TerminationPolicies: " + getTerminationPolicies() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getLaunchConfigurationName() == null) ? 0 : getLaunchConfigurationName().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getMinSize() == null) ? 0 : getMinSize().hashCode()); 
        hashCode = prime * hashCode + ((getMaxSize() == null) ? 0 : getMaxSize().hashCode()); 
        hashCode = prime * hashCode + ((getDesiredCapacity() == null) ? 0 : getDesiredCapacity().hashCode()); 
        hashCode = prime * hashCode + ((getDefaultCooldown() == null) ? 0 : getDefaultCooldown().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); 
        hashCode = prime * hashCode + ((getLoadBalancerNames() == null) ? 0 : getLoadBalancerNames().hashCode()); 
        hashCode = prime * hashCode + ((getHealthCheckType() == null) ? 0 : getHealthCheckType().hashCode()); 
        hashCode = prime * hashCode + ((getHealthCheckGracePeriod() == null) ? 0 : getHealthCheckGracePeriod().hashCode()); 
        hashCode = prime * hashCode + ((getPlacementGroup() == null) ? 0 : getPlacementGroup().hashCode()); 
        hashCode = prime * hashCode + ((getVPCZoneIdentifier() == null) ? 0 : getVPCZoneIdentifier().hashCode()); 
        hashCode = prime * hashCode + ((getTerminationPolicies() == null) ? 0 : getTerminationPolicies().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateAutoScalingGroupRequest == falsereturn false;
        
        if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == nullreturn false;
        if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == falsereturn false
        if (other.getLaunchConfigurationName() == null ^ this.getLaunchConfigurationName() == nullreturn false;
        if (other.getLaunchConfigurationName() != null && other.getLaunchConfigurationName().equals(this.getLaunchConfigurationName()) == falsereturn false
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getMinSize() == null ^ this.getMinSize() == nullreturn false;
        if (other.getMinSize() != null && other.getMinSize().equals(this.getMinSize()) == falsereturn false
        if (other.getMaxSize() == null ^ this.getMaxSize() == nullreturn false;
        if (other.getMaxSize() != null && other.getMaxSize().equals(this.getMaxSize()) == falsereturn false
        if (other.getDesiredCapacity() == null ^ this.getDesiredCapacity() == nullreturn false;
        if (other.getDesiredCapacity() != null && other.getDesiredCapacity().equals(this.getDesiredCapacity()) == falsereturn false
        if (other.getDefaultCooldown() == null ^ this.getDefaultCooldown() == nullreturn false;
        if (other.getDefaultCooldown() != null && other.getDefaultCooldown().equals(this.getDefaultCooldown()) == falsereturn false
        if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == nullreturn false;
        if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == falsereturn false
        if (other.getLoadBalancerNames() == null ^ this.getLoadBalancerNames() == nullreturn false;
        if (other.getLoadBalancerNames() != null && other.getLoadBalancerNames().equals(this.getLoadBalancerNames()) == falsereturn false
        if (other.getHealthCheckType() == null ^ this.getHealthCheckType() == nullreturn false;
        if (other.getHealthCheckType() != null && other.getHealthCheckType().equals(this.getHealthCheckType()) == falsereturn false
        if (other.getHealthCheckGracePeriod() == null ^ this.getHealthCheckGracePeriod() == nullreturn false;
        if (other.getHealthCheckGracePeriod() != null && other.getHealthCheckGracePeriod().equals(this.getHealthCheckGracePeriod()) == falsereturn false
        if (other.getPlacementGroup() == null ^ this.getPlacementGroup() == nullreturn false;
        if (other.getPlacementGroup() != null && other.getPlacementGroup().equals(this.getPlacementGroup()) == falsereturn false
        if (other.getVPCZoneIdentifier() == null ^ this.getVPCZoneIdentifier() == nullreturn false;
        if (other.getVPCZoneIdentifier() != null && other.getVPCZoneIdentifier().equals(this.getVPCZoneIdentifier()) == falsereturn false
        if (other.getTerminationPolicies() == null ^ this.getTerminationPolicies() == nullreturn false;
        if (other.getTerminationPolicies() != null && other.getTerminationPolicies().equals(this.getTerminationPolicies()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (CreateAutoScalingGroupRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X