/* * Copyright 2018-2023 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; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateAutoScalingGroupRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the Auto Scaling group. This name must be unique per Region per account. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and upper and * lowercased letters. *
** You cannot use a colon (:) in the name. *
** The name of the launch configuration to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* Information used to specify the launch template and version to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a launch * template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
** The mixed instances policy. For more information, see Auto * Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User * Guide. *
*/ private MixedInstancesPolicy mixedInstancesPolicy; /** ** The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the * configuration values from the specified instance to create a new launch configuration. To get the instance ID, * use the Amazon EC2 DescribeInstances * API operation. For more information, see Creating an Auto * Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. *
*/ private String instanceId; /** ** The minimum size of the group. *
*/ private Integer minSize; /** ** The maximum size of the group. *
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go
* above MaxSize
by more than your largest instance weight (weights that define how many units each
* instance contributes to the desired capacity of the group).
*
* The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the * capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number * 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. If you do not specify a desired capacity, the default is the minimum size of the group. *
*/ private Integer desiredCapacity; /** ** Only needed if you use simple scaling policies. *
** The amount of time, in seconds, between one scaling activity ending and another one starting due to simple * scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto * Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
*
* A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into
* the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier
property, or
* for attaching a network interface when an existing network interface ID is specified in a launch template.
*
* A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network
* Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs
property instead.
*
* The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling * group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and * route requests to one or more registered targets. For more information, see Use Elastic Load * Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto * Scaling User Guide. *
*/ private com.amazonaws.internal.SdkInternalList* A comma-separated value string of one or more health check types. *
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is the
* default health check and cannot be disabled. For more information, see Health checks for Auto Scaling
* instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
*
* The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2
* instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your
* instances do not immediately pass their health checks after they enter the InService
state. For more
* information, see Set the health check
* grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
* Default: 0
seconds
*
* The name of the placement group into which to launch your instances. For more information, see Placement groups in the * Amazon EC2 User Guide for Linux Instances. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot * specify multiple Availability Zones and a cluster placement group. *
*
* A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group
* can be created. If you specify VPCZoneIdentifier
with AvailabilityZones
, the subnets
* that you specify must reside in those Availability Zones.
*
* A policy or a list of policies that are used to select the instance to terminate. These policies are executed in * the order that you list them. For more information, see Work with * Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide. *
*
* Valid values: Default
| AllocationStrategy
| ClosestToNextInstanceHour
|
* NewestInstance
| OldestInstance
| OldestLaunchConfiguration
|
* OldestLaunchTemplate
| arn:aws:lambda:region:account-id:function:my-function:my-alias
*
* Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling * in. For more information about preventing instances from terminating on scale in, see Using * instance scale-in protection in the Amazon EC2 Auto Scaling User Guide. *
*/ private Boolean newInstancesProtectedFromScaleIn; /** ** Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on * Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies * that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates * an old instance. For more information, see Use * Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User * Guide. *
*/ private Boolean capacityRebalance; /** ** One or more lifecycle hooks to add to the Auto Scaling group before instances are launched. *
*/ private com.amazonaws.internal.SdkInternalList* One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it * launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a * launch template but use caution. If the launch template specifies an instance tag with a key that is also * specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the * value specified by the Auto Scaling group. For more information, see Tag Auto Scaling * groups and instances in the Amazon EC2 Auto Scaling User Guide. *
*/ private com.amazonaws.internal.SdkInternalList
* The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon
* Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named
* AWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more information, see Service-linked
* roles in the Amazon EC2 Auto Scaling User Guide.
*
* The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, * the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see * Replacing Auto * Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide. *
*/ private Integer maxInstanceLifetime; /** ** Reserved. *
*/ private String context; /** *
* The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports
* DesiredCapacityType
for attribute-based instance type selection only. For more information, see Creating
* an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User
* Guide.
*
* By default, Amazon EC2 Auto Scaling specifies units
, which translates into number of instances.
*
* Valid values: units
| vcpu
| memory-mib
*
* The amount of time, in seconds, until a new instance is considered to have finished initializing and resource
* consumption to become stable after it enters the InService
state.
*
* During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance * before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period * before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that * are used for scaling, resulting in more reliable usage data. For more information, see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance warmup,
* even if it is set to 0 seconds. To remove a value that you previously set, include the property but
* specify -1
for the value. However, we strongly recommend keeping the default instance warmup enabled
* by specifying a value of 0
or other nominal value.
*
* Default: None *
*/ private Integer defaultInstanceWarmup; /** ** The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic * sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, * Network Load Balancer, and VPC Lattice. *
*/ private com.amazonaws.internal.SdkInternalList* The name of the Auto Scaling group. This name must be unique per Region per account. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and upper and * lowercased letters. *
** You cannot use a colon (:) in the name. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and * upper and lowercased letters. *
** You cannot use a colon (:) in the name. *
*/ public void setAutoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; } /** ** The name of the Auto Scaling group. This name must be unique per Region per account. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and upper and * lowercased letters. *
** You cannot use a colon (:) in the name. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and * upper and lowercased letters. *
** You cannot use a colon (:) in the name. *
*/ public String getAutoScalingGroupName() { return this.autoScalingGroupName; } /** ** The name of the Auto Scaling group. This name must be unique per Region per account. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and upper and * lowercased letters. *
** You cannot use a colon (:) in the name. *
** The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, and * upper and lowercased letters. *
** You cannot use a colon (:) in the name. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withAutoScalingGroupName(String autoScalingGroupName) { setAutoScalingGroupName(autoScalingGroupName); return this; } /** ** The name of the launch configuration to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*/
public void setLaunchConfigurationName(String launchConfigurationName) {
this.launchConfigurationName = launchConfigurationName;
}
/**
*
* The name of the launch configuration to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*/
public String getLaunchConfigurationName() {
return this.launchConfigurationName;
}
/**
*
* The name of the launch configuration to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withLaunchConfigurationName(String launchConfigurationName) {
setLaunchConfigurationName(launchConfigurationName);
return this;
}
/**
*
* Information used to specify the launch template and version to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a launch * template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a launch * template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*/ public void setLaunchTemplate(LaunchTemplateSpecification launchTemplate) { this.launchTemplate = launchTemplate; } /** ** Information used to specify the launch template and version to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a launch * template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a * launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*/ public LaunchTemplateSpecification getLaunchTemplate() { return this.launchTemplate; } /** ** Information used to specify the launch template and version to use to launch instances. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a launch * template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* Conditional: You must specify either a launch template (LaunchTemplate
or
* MixedInstancesPolicy
) or a launch configuration (LaunchConfigurationName
or
* InstanceId
).
*
* The launch template that is specified must be configured for use with an Auto Scaling group. For more * information, see Creating a launch * template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withLaunchTemplate(LaunchTemplateSpecification launchTemplate) { setLaunchTemplate(launchTemplate); return this; } /** ** The mixed instances policy. For more information, see Auto * Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User * Guide. *
* * @param mixedInstancesPolicy * The mixed instances policy. For more information, see Auto * Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling * User Guide. */ public void setMixedInstancesPolicy(MixedInstancesPolicy mixedInstancesPolicy) { this.mixedInstancesPolicy = mixedInstancesPolicy; } /** ** The mixed instances policy. For more information, see Auto * Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User * Guide. *
* * @return The mixed instances policy. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto * Scaling User Guide. */ public MixedInstancesPolicy getMixedInstancesPolicy() { return this.mixedInstancesPolicy; } /** ** The mixed instances policy. For more information, see Auto * Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User * Guide. *
* * @param mixedInstancesPolicy * The mixed instances policy. For more information, see Auto * Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling * User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withMixedInstancesPolicy(MixedInstancesPolicy mixedInstancesPolicy) { setMixedInstancesPolicy(mixedInstancesPolicy); return this; } /** ** The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the * configuration values from the specified instance to create a new launch configuration. To get the instance ID, * use the Amazon EC2 DescribeInstances * API operation. For more information, see Creating an Auto * Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. *
* * @param instanceId * The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling * uses the configuration values from the specified instance to create a new launch configuration. To get the * instance ID, use the Amazon EC2 DescribeInstances API operation. For more information, see Creating an * Auto Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. */ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } /** ** The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the * configuration values from the specified instance to create a new launch configuration. To get the instance ID, * use the Amazon EC2 DescribeInstances * API operation. For more information, see Creating an Auto * Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. *
* * @return The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling * uses the configuration values from the specified instance to create a new launch configuration. To get * the instance ID, use the Amazon EC2 DescribeInstances API operation. For more information, see Creating an * Auto Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. */ public String getInstanceId() { return this.instanceId; } /** ** The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the * configuration values from the specified instance to create a new launch configuration. To get the instance ID, * use the Amazon EC2 DescribeInstances * API operation. For more information, see Creating an Auto * Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. *
* * @param instanceId * The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling * uses the configuration values from the specified instance to create a new launch configuration. To get the * instance ID, use the Amazon EC2 DescribeInstances API operation. For more information, see Creating an * Auto Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withInstanceId(String instanceId) { setInstanceId(instanceId); return this; } /** ** The minimum size of the group. *
* * @param minSize * The minimum size of the group. */ public void setMinSize(Integer minSize) { this.minSize = minSize; } /** ** The minimum size of the group. *
* * @return The minimum size of the group. */ public Integer getMinSize() { return this.minSize; } /** ** The minimum size of the group. *
* * @param minSize * The minimum size of the group. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withMinSize(Integer minSize) { setMinSize(minSize); return this; } /** ** The maximum size of the group. *
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go
* above MaxSize
by more than your largest instance weight (weights that define how many units each
* instance contributes to the desired capacity of the group).
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never
* go above MaxSize
by more than your largest instance weight (weights that define how many
* units each instance contributes to the desired capacity of the group).
*
* The maximum size of the group. *
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go
* above MaxSize
by more than your largest instance weight (weights that define how many units each
* instance contributes to the desired capacity of the group).
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will
* never go above MaxSize
by more than your largest instance weight (weights that define how
* many units each instance contributes to the desired capacity of the group).
*
* The maximum size of the group. *
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go
* above MaxSize
by more than your largest instance weight (weights that define how many units each
* instance contributes to the desired capacity of the group).
*
* With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
* MaxSize
to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never
* go above MaxSize
by more than your largest instance weight (weights that define how many
* units each instance contributes to the desired capacity of the group).
*
* The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the * capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number * 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. If you do not specify a desired capacity, the default is the minimum size of the group. *
* * @param desiredCapacity * The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the * capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This * number 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. If you do not specify a desired capacity, the default is the minimum size of * the group. */ public void setDesiredCapacity(Integer desiredCapacity) { this.desiredCapacity = desiredCapacity; } /** ** The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the * capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number * 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. If you do not specify a desired capacity, the default is the minimum size of the group. *
* * @return The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and * the capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. * This number 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. If you do not specify a desired capacity, the default is the minimum size of * the group. */ public Integer getDesiredCapacity() { return this.desiredCapacity; } /** ** The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the * capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number * 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. If you do not specify a desired capacity, the default is the minimum size of the group. *
* * @param desiredCapacity * The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the * capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This * number 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. If you do not specify a desired capacity, the default is the minimum size of * the group. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withDesiredCapacity(Integer desiredCapacity) { setDesiredCapacity(desiredCapacity); return this; } /** ** Only needed if you use simple scaling policies. *
** The amount of time, in seconds, between one scaling activity ending and another one starting due to simple * scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto * Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
*
* The amount of time, in seconds, between one scaling activity ending and another one starting due to simple * scaling policies. For more information, see Scaling cooldowns for Amazon * EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
*/
public void setDefaultCooldown(Integer defaultCooldown) {
this.defaultCooldown = defaultCooldown;
}
/**
*
* Only needed if you use simple scaling policies. *
** The amount of time, in seconds, between one scaling activity ending and another one starting due to simple * scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto * Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
*
* The amount of time, in seconds, between one scaling activity ending and another one starting due to * simple scaling policies. For more information, see Scaling cooldowns for Amazon * EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
*/
public Integer getDefaultCooldown() {
return this.defaultCooldown;
}
/**
*
* Only needed if you use simple scaling policies. *
** The amount of time, in seconds, between one scaling activity ending and another one starting due to simple * scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto * Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
*
* The amount of time, in seconds, between one scaling activity ending and another one starting due to simple * scaling policies. For more information, see Scaling cooldowns for Amazon * EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. *
*
* Default: 300
seconds
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withDefaultCooldown(Integer defaultCooldown) {
setDefaultCooldown(defaultCooldown);
return this;
}
/**
*
* A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into
* the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier
property, or
* for attaching a network interface when an existing network interface ID is specified in a launch template.
*
VPCZoneIdentifier
* property, or for attaching a network interface when an existing network interface ID is specified in a
* launch template.
*/
public java.util.List
* A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into
* the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier
property, or
* for attaching a network interface when an existing network interface ID is specified in a launch template.
*
VPCZoneIdentifier
* property, or for attaching a network interface when an existing network interface ID is specified in a
* launch template.
*/
public void setAvailabilityZones(java.util.Collection
* A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into
* the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier
property, or
* for attaching a network interface when an existing network interface ID is specified in a launch template.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setAvailabilityZones(java.util.Collection)} or {@link #withAvailabilityZones(java.util.Collection)} if * you want to override the existing values. *
* * @param availabilityZones * A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching * into the default VPC subnet in each Availability Zone when not using theVPCZoneIdentifier
* property, or for attaching a network interface when an existing network interface ID is specified in a
* launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withAvailabilityZones(String... availabilityZones) {
if (this.availabilityZones == null) {
setAvailabilityZones(new com.amazonaws.internal.SdkInternalList
* A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into
* the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier
property, or
* for attaching a network interface when an existing network interface ID is specified in a launch template.
*
VPCZoneIdentifier
* property, or for attaching a network interface when an existing network interface ID is specified in a
* launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withAvailabilityZones(java.util.Collection
* A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network
* Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs
property instead.
*
TargetGroupARNs
property
* instead.
*/
public java.util.List
* A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network
* Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs
property instead.
*
TargetGroupARNs
property
* instead.
*/
public void setLoadBalancerNames(java.util.Collection
* A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network
* Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs
property instead.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setLoadBalancerNames(java.util.Collection)} or {@link #withLoadBalancerNames(java.util.Collection)} if * you want to override the existing values. *
* * @param loadBalancerNames * A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, * Network Load Balancers, and Gateway Load Balancers, specify theTargetGroupARNs
property
* instead.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withLoadBalancerNames(String... loadBalancerNames) {
if (this.loadBalancerNames == null) {
setLoadBalancerNames(new com.amazonaws.internal.SdkInternalList
* A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network
* Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs
property instead.
*
TargetGroupARNs
property
* instead.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withLoadBalancerNames(java.util.Collection* The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling * group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and * route requests to one or more registered targets. For more information, see Use Elastic Load * Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto * Scaling User Guide. *
* * @return The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto * Scaling group. Instances are registered as targets with the target groups. The target groups receive * incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic * Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon * EC2 Auto Scaling User Guide. */ public java.util.List* The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling * group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and * route requests to one or more registered targets. For more information, see Use Elastic Load * Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto * Scaling User Guide. *
* * @param targetGroupARNs * The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto * Scaling group. Instances are registered as targets with the target groups. The target groups receive * incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic * Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon * EC2 Auto Scaling User Guide. */ public void setTargetGroupARNs(java.util.Collection* The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling * group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and * route requests to one or more registered targets. For more information, see Use Elastic Load * Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto * Scaling User Guide. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTargetGroupARNs(java.util.Collection)} or {@link #withTargetGroupARNs(java.util.Collection)} if you * want to override the existing values. *
* * @param targetGroupARNs * The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto * Scaling group. Instances are registered as targets with the target groups. The target groups receive * incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic * Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon * EC2 Auto Scaling User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withTargetGroupARNs(String... targetGroupARNs) { if (this.targetGroupARNs == null) { setTargetGroupARNs(new com.amazonaws.internal.SdkInternalList* The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling * group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and * route requests to one or more registered targets. For more information, see Use Elastic Load * Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto * Scaling User Guide. *
* * @param targetGroupARNs * The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto * Scaling group. Instances are registered as targets with the target groups. The target groups receive * incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic * Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon * EC2 Auto Scaling User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withTargetGroupARNs(java.util.Collection* A comma-separated value string of one or more health check types. *
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is the
* default health check and cannot be disabled. For more information, see Health checks for Auto Scaling
* instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is
* the default health check and cannot be disabled. For more information, see Health checks for Auto
* Scaling instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
*/
public void setHealthCheckType(String healthCheckType) {
this.healthCheckType = healthCheckType;
}
/**
*
* A comma-separated value string of one or more health check types. *
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is the
* default health check and cannot be disabled. For more information, see Health checks for Auto Scaling
* instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
* is the default health check and cannot be disabled. For more information, see Health checks for Auto
* Scaling instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
*/
public String getHealthCheckType() {
return this.healthCheckType;
}
/**
*
* A comma-separated value string of one or more health check types. *
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is the
* default health check and cannot be disabled. For more information, see Health checks for Auto Scaling
* instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
*
* The valid values are EC2
, ELB
, and VPC_LATTICE
. EC2
is
* the default health check and cannot be disabled. For more information, see Health checks for Auto
* Scaling instances in the Amazon EC2 Auto Scaling User Guide.
*
* Only specify EC2
if you must clear a value that was previously set.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withHealthCheckType(String healthCheckType) {
setHealthCheckType(healthCheckType);
return this;
}
/**
*
* The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2
* instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your
* instances do not immediately pass their health checks after they enter the InService
state. For more
* information, see Set the health check
* grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
* Default: 0
seconds
*
InService
state. For more information, see Set the health
* check grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
* Default: 0
seconds
*/
public void setHealthCheckGracePeriod(Integer healthCheckGracePeriod) {
this.healthCheckGracePeriod = healthCheckGracePeriod;
}
/**
*
* The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2
* instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your
* instances do not immediately pass their health checks after they enter the InService
state. For more
* information, see Set the health check
* grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
* Default: 0
seconds
*
InService
state. For more information, see Set the
* health check grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User
* Guide.
*
* Default: 0
seconds
*/
public Integer getHealthCheckGracePeriod() {
return this.healthCheckGracePeriod;
}
/**
*
* The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2
* instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your
* instances do not immediately pass their health checks after they enter the InService
state. For more
* information, see Set the health check
* grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
* Default: 0
seconds
*
InService
state. For more information, see Set the health
* check grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
* Default: 0
seconds
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withHealthCheckGracePeriod(Integer healthCheckGracePeriod) {
setHealthCheckGracePeriod(healthCheckGracePeriod);
return this;
}
/**
*
* The name of the placement group into which to launch your instances. For more information, see Placement groups in the * Amazon EC2 User Guide for Linux Instances. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot * specify multiple Availability Zones and a cluster placement group. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. You * cannot specify multiple Availability Zones and a cluster placement group. *
*/ public void setPlacementGroup(String placementGroup) { this.placementGroup = placementGroup; } /** ** The name of the placement group into which to launch your instances. For more information, see Placement groups in the * Amazon EC2 User Guide for Linux Instances. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot * specify multiple Availability Zones and a cluster placement group. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. * You cannot specify multiple Availability Zones and a cluster placement group. *
*/ public String getPlacementGroup() { return this.placementGroup; } /** ** The name of the placement group into which to launch your instances. For more information, see Placement groups in the * Amazon EC2 User Guide for Linux Instances. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot * specify multiple Availability Zones and a cluster placement group. *
** A cluster placement group is a logical grouping of instances within a single Availability Zone. You * cannot specify multiple Availability Zones and a cluster placement group. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withPlacementGroup(String placementGroup) { setPlacementGroup(placementGroup); return this; } /** *
* A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group
* can be created. If you specify VPCZoneIdentifier
with AvailabilityZones
, the subnets
* that you specify must reside in those Availability Zones.
*
VPCZoneIdentifier
with AvailabilityZones
,
* the subnets that you specify must reside in those Availability Zones.
*/
public void setVPCZoneIdentifier(String vPCZoneIdentifier) {
this.vPCZoneIdentifier = vPCZoneIdentifier;
}
/**
*
* A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group
* can be created. If you specify VPCZoneIdentifier
with AvailabilityZones
, the subnets
* that you specify must reside in those Availability Zones.
*
VPCZoneIdentifier
with
* AvailabilityZones
, the subnets that you specify must reside in those Availability Zones.
*/
public String getVPCZoneIdentifier() {
return this.vPCZoneIdentifier;
}
/**
*
* A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group
* can be created. If you specify VPCZoneIdentifier
with AvailabilityZones
, the subnets
* that you specify must reside in those Availability Zones.
*
VPCZoneIdentifier
with AvailabilityZones
,
* the subnets that you specify must reside in those Availability Zones.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withVPCZoneIdentifier(String vPCZoneIdentifier) {
setVPCZoneIdentifier(vPCZoneIdentifier);
return this;
}
/**
* * A policy or a list of policies that are used to select the instance to terminate. These policies are executed in * the order that you list them. For more information, see Work with * Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide. *
*
* Valid values: Default
| AllocationStrategy
| ClosestToNextInstanceHour
|
* NewestInstance
| OldestInstance
| OldestLaunchConfiguration
|
* OldestLaunchTemplate
| arn:aws:lambda:region:account-id:function:my-function:my-alias
*
* Valid values:
* A policy or a list of policies that are used to select the instance to terminate. These policies are executed in
* the order that you list them. For more information, see Work with
* Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide.
*
* Valid values: Default
| AllocationStrategy
|
* ClosestToNextInstanceHour
| NewestInstance
| OldestInstance
|
* OldestLaunchConfiguration
| OldestLaunchTemplate
|
* arn:aws:lambda:region:account-id:function:my-function:my-alias
*/
public java.util.ListDefault
| AllocationStrategy
| ClosestToNextInstanceHour
|
* NewestInstance
| OldestInstance
| OldestLaunchConfiguration
|
* OldestLaunchTemplate
| arn:aws:lambda:region:account-id:function:my-function:my-alias
*
* Valid values:
* A policy or a list of policies that are used to select the instance to terminate. These policies are executed in
* the order that you list them. For more information, see Work with
* Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide.
*
* Valid values:
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTerminationPolicies(java.util.Collection)} or {@link #withTerminationPolicies(java.util.Collection)}
* if you want to override the existing values.
* Default
| AllocationStrategy
|
* ClosestToNextInstanceHour
| NewestInstance
| OldestInstance
|
* OldestLaunchConfiguration
| OldestLaunchTemplate
|
* arn:aws:lambda:region:account-id:function:my-function:my-alias
*/
public void setTerminationPolicies(java.util.CollectionDefault
| AllocationStrategy
| ClosestToNextInstanceHour
|
* NewestInstance
| OldestInstance
| OldestLaunchConfiguration
|
* OldestLaunchTemplate
| arn:aws:lambda:region:account-id:function:my-function:my-alias
*
* Valid values:
* A policy or a list of policies that are used to select the instance to terminate. These policies are executed in
* the order that you list them. For more information, see Work with
* Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide.
*
* Valid values: Default
| AllocationStrategy
|
* ClosestToNextInstanceHour
| NewestInstance
| OldestInstance
|
* OldestLaunchConfiguration
| OldestLaunchTemplate
|
* arn:aws:lambda:region:account-id:function:my-function:my-alias
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withTerminationPolicies(String... terminationPolicies) {
if (this.terminationPolicies == null) {
setTerminationPolicies(new com.amazonaws.internal.SdkInternalListDefault
| AllocationStrategy
| ClosestToNextInstanceHour
|
* NewestInstance
| OldestInstance
| OldestLaunchConfiguration
|
* OldestLaunchTemplate
| arn:aws:lambda:region:account-id:function:my-function:my-alias
*
* Valid values:
* Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling
* in. For more information about preventing instances from terminating on scale in, see Using
* instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
*
* Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling
* in. For more information about preventing instances from terminating on scale in, see Using
* instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
*
* Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling
* in. For more information about preventing instances from terminating on scale in, see Using
* instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
*
* Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling
* in. For more information about preventing instances from terminating on scale in, see Using
* instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
*
* Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on
* Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies
* that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates
* an old instance. For more information, see Use
* Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User
* Guide.
*
* Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on
* Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies
* that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates
* an old instance. For more information, see Use
* Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User
* Guide.
*
* Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on
* Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies
* that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates
* an old instance. For more information, see Use
* Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User
* Guide.
*
* Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on
* Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies
* that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates
* an old instance. For more information, see Use
* Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User
* Guide.
*
* One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
*
* One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
*
* One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLifecycleHookSpecificationList(java.util.Collection)} or
* {@link #withLifecycleHookSpecificationList(java.util.Collection)} if you want to override the existing values.
*
* One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
*
* One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it
* launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a
* launch template but use caution. If the launch template specifies an instance tag with a key that is also
* specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the
* value specified by the Auto Scaling group. For more information, see Tag Auto Scaling
* groups and instances in the Amazon EC2 Auto Scaling User Guide.
*
* One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it
* launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a
* launch template but use caution. If the launch template specifies an instance tag with a key that is also
* specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the
* value specified by the Auto Scaling group. For more information, see Tag Auto Scaling
* groups and instances in the Amazon EC2 Auto Scaling User Guide.
*
* One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it
* launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a
* launch template but use caution. If the launch template specifies an instance tag with a key that is also
* specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the
* value specified by the Auto Scaling group. For more information, see Tag Auto Scaling
* groups and instances in the Amazon EC2 Auto Scaling User Guide.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
* One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it
* launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a
* launch template but use caution. If the launch template specifies an instance tag with a key that is also
* specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the
* value specified by the Auto Scaling group. For more information, see Tag Auto Scaling
* groups and instances in the Amazon EC2 Auto Scaling User Guide.
*
* The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon
* Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named
*
* The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon
* Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named
*
* The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon
* Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named
*
* The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified,
* the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see
* Replacing Auto
* Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
*
* The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified,
* the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see
* Replacing Auto
* Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
*
* The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified,
* the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see
* Replacing Auto
* Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
*
* Reserved.
*
* Reserved.
*
* Reserved.
*
* The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports
*
* By default, Amazon EC2 Auto Scaling specifies
* Valid values: Default
| AllocationStrategy
|
* ClosestToNextInstanceHour
| NewestInstance
| OldestInstance
|
* OldestLaunchConfiguration
| OldestLaunchTemplate
|
* arn:aws:lambda:region:account-id:function:my-function:my-alias
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withTerminationPolicies(java.util.CollectionAWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more information, see Service-linked
* roles in the Amazon EC2 Auto Scaling User Guide.
* AWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more
* information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
*/
public void setServiceLinkedRoleARN(String serviceLinkedRoleARN) {
this.serviceLinkedRoleARN = serviceLinkedRoleARN;
}
/**
* AWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more information, see Service-linked
* roles in the Amazon EC2 Auto Scaling User Guide.
* AWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more
* information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
*/
public String getServiceLinkedRoleARN() {
return this.serviceLinkedRoleARN;
}
/**
* AWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more information, see Service-linked
* roles in the Amazon EC2 Auto Scaling User Guide.
* AWSServiceRoleForAutoScaling
, which it creates if it does not exist. For more
* information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withServiceLinkedRoleARN(String serviceLinkedRoleARN) {
setServiceLinkedRoleARN(serviceLinkedRoleARN);
return this;
}
/**
* DesiredCapacityType
for attribute-based instance type selection only. For more information, see Creating
* an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User
* Guide.
* units
, which translates into number of instances.
* units
| vcpu
| memory-mib
* DesiredCapacityType
for attribute-based instance type selection only. For more information,
* see Creating an Auto Scaling group using attribute-based instance type selection in the Amazon EC2
* Auto Scaling User Guide.
* By default, Amazon EC2 Auto Scaling specifies units
, which translates into number of
* instances.
*
* Valid values: units
| vcpu
| memory-mib
*/
public void setDesiredCapacityType(String desiredCapacityType) {
this.desiredCapacityType = desiredCapacityType;
}
/**
*
* The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports
* DesiredCapacityType
for attribute-based instance type selection only. For more information, see Creating
* an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User
* Guide.
*
* By default, Amazon EC2 Auto Scaling specifies units
, which translates into number of instances.
*
* Valid values: units
| vcpu
| memory-mib
*
DesiredCapacityType
for attribute-based instance type selection only. For more information,
* see Creating an Auto Scaling group using attribute-based instance type selection in the Amazon EC2
* Auto Scaling User Guide.
*
* By default, Amazon EC2 Auto Scaling specifies units
, which translates into number of
* instances.
*
* Valid values: units
| vcpu
| memory-mib
*/
public String getDesiredCapacityType() {
return this.desiredCapacityType;
}
/**
*
* The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports
* DesiredCapacityType
for attribute-based instance type selection only. For more information, see Creating
* an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User
* Guide.
*
* By default, Amazon EC2 Auto Scaling specifies units
, which translates into number of instances.
*
* Valid values: units
| vcpu
| memory-mib
*
DesiredCapacityType
for attribute-based instance type selection only. For more information,
* see Creating an Auto Scaling group using attribute-based instance type selection in the Amazon EC2
* Auto Scaling User Guide.
*
* By default, Amazon EC2 Auto Scaling specifies units
, which translates into number of
* instances.
*
* Valid values: units
| vcpu
| memory-mib
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAutoScalingGroupRequest withDesiredCapacityType(String desiredCapacityType) {
setDesiredCapacityType(desiredCapacityType);
return this;
}
/**
*
* The amount of time, in seconds, until a new instance is considered to have finished initializing and resource
* consumption to become stable after it enters the InService
state.
*
* During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance * before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period * before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that * are used for scaling, resulting in more reliable usage data. For more information, see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance warmup,
* even if it is set to 0 seconds. To remove a value that you previously set, include the property but
* specify -1
for the value. However, we strongly recommend keeping the default instance warmup enabled
* by specifying a value of 0
or other nominal value.
*
* Default: None *
* * @param defaultInstanceWarmup * The amount of time, in seconds, until a new instance is considered to have finished initializing and * resource consumption to become stable after it enters theInService
state.
* * During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an * instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the * warm-up period before aggregating the metrics for new instances with existing instances in the Amazon * CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, * see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User * Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance
* warmup, even if it is set to 0 seconds. To remove a value that you previously set, include the
* property but specify -1
for the value. However, we strongly recommend keeping the default
* instance warmup enabled by specifying a value of 0
or other nominal value.
*
* Default: None */ public void setDefaultInstanceWarmup(Integer defaultInstanceWarmup) { this.defaultInstanceWarmup = defaultInstanceWarmup; } /** *
* The amount of time, in seconds, until a new instance is considered to have finished initializing and resource
* consumption to become stable after it enters the InService
state.
*
* During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance * before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period * before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that * are used for scaling, resulting in more reliable usage data. For more information, see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance warmup,
* even if it is set to 0 seconds. To remove a value that you previously set, include the property but
* specify -1
for the value. However, we strongly recommend keeping the default instance warmup enabled
* by specifying a value of 0
or other nominal value.
*
* Default: None *
* * @return The amount of time, in seconds, until a new instance is considered to have finished initializing and * resource consumption to become stable after it enters theInService
state.
* * During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an * instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the * warm-up period before aggregating the metrics for new instances with existing instances in the Amazon * CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more * information, see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User * Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance
* warmup, even if it is set to 0 seconds. To remove a value that you previously set, include the
* property but specify -1
for the value. However, we strongly recommend keeping the default
* instance warmup enabled by specifying a value of 0
or other nominal value.
*
* Default: None */ public Integer getDefaultInstanceWarmup() { return this.defaultInstanceWarmup; } /** *
* The amount of time, in seconds, until a new instance is considered to have finished initializing and resource
* consumption to become stable after it enters the InService
state.
*
* During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance * before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period * before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that * are used for scaling, resulting in more reliable usage data. For more information, see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance warmup,
* even if it is set to 0 seconds. To remove a value that you previously set, include the property but
* specify -1
for the value. However, we strongly recommend keeping the default instance warmup enabled
* by specifying a value of 0
or other nominal value.
*
* Default: None *
* * @param defaultInstanceWarmup * The amount of time, in seconds, until a new instance is considered to have finished initializing and * resource consumption to become stable after it enters theInService
state.
* * During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an * instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the * warm-up period before aggregating the metrics for new instances with existing instances in the Amazon * CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, * see Set * the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User * Guide. *
*
* To manage various warm-up settings at the group level, we recommend that you set the default instance
* warmup, even if it is set to 0 seconds. To remove a value that you previously set, include the
* property but specify -1
for the value. However, we strongly recommend keeping the default
* instance warmup enabled by specifying a value of 0
or other nominal value.
*
* Default: None * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withDefaultInstanceWarmup(Integer defaultInstanceWarmup) { setDefaultInstanceWarmup(defaultInstanceWarmup); return this; } /** *
* The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic * sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, * Network Load Balancer, and VPC Lattice. *
* * @return The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as * traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load * Balancer, Network Load Balancer, and VPC Lattice. */ public java.util.List* The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic * sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, * Network Load Balancer, and VPC Lattice. *
* * @param trafficSources * The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as * traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load * Balancer, Network Load Balancer, and VPC Lattice. */ public void setTrafficSources(java.util.Collection* The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic * sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, * Network Load Balancer, and VPC Lattice. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTrafficSources(java.util.Collection)} or {@link #withTrafficSources(java.util.Collection)} if you want * to override the existing values. *
* * @param trafficSources * The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as * traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load * Balancer, Network Load Balancer, and VPC Lattice. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withTrafficSources(TrafficSourceIdentifier... trafficSources) { if (this.trafficSources == null) { setTrafficSources(new com.amazonaws.internal.SdkInternalList* The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic * sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, * Network Load Balancer, and VPC Lattice. *
* * @param trafficSources * The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as * traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load * Balancer, Network Load Balancer, and VPC Lattice. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAutoScalingGroupRequest withTrafficSources(java.util.Collection