Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
__We strongly recommend that all Auto Scaling groups use launch templates to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2.__
Updates the configuration for the specified Auto Scaling group.
To update an Auto Scaling group, specify the name of the group and the parameter that you want to change. Any parameters that you don't specify are not changed by this update request. The new settings take effect on any scaling activities after this call returns.
If you associate a new launch configuration or template with an Auto Scaling group, all new instances will get the updated configuration. Existing instances continue to run with the configuration that they were originally launched with. When you update a group to specify a mixed instances policy instead of a launch configuration or template, existing instances may be replaced to match the new purchasing options that you specified in the policy. For example, if the group currently has 100% On-Demand capacity and the policy specifies 50% Spot capacity, this means that half of your instances will be gradually terminated and relaunched as Spot Instances. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the old ones, so that updating your group does not compromise the performance or availability of your application.
Note the following about changing DesiredCapacity
, MaxSize
, or
MinSize
:
- If a scale-in activity occurs as a result of a new
DesiredCapacity
value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. - If you specify a new value for
MinSize
without specifying a value forDesiredCapacity
, and the newMinSize
is larger than the current size of the group, this sets the group'sDesiredCapacity
to the newMinSize
value. - If you specify a new value for
MaxSize
without specifying a value forDesiredCapacity
, and the newMaxSize
is smaller than the current size of the group, this sets the group'sDesiredCapacity
to the newMaxSize
value.
To see which parameters have been set, call the DescribeAutoScalingGroups API. To view the scaling policies for an Auto Scaling group, call the DescribePolicies API. If the group has scaling policies, you can update them by calling the PutScalingPolicy API.
Synopsis
- data UpdateAutoScalingGroup = UpdateAutoScalingGroup' {
- context :: Maybe Text
- terminationPolicies :: Maybe [Text]
- healthCheckGracePeriod :: Maybe Int
- serviceLinkedRoleARN :: Maybe Text
- newInstancesProtectedFromScaleIn' :: Maybe Bool
- vPCZoneIdentifier :: Maybe Text
- maxInstanceLifetime :: Maybe Int
- defaultCooldown :: Maybe Int
- maxSize :: Maybe Int
- availabilityZones :: Maybe [Text]
- desiredCapacity :: Maybe Int
- mixedInstancesPolicy :: Maybe MixedInstancesPolicy
- minSize :: Maybe Int
- launchConfigurationName :: Maybe Text
- healthCheckType :: Maybe Text
- launchTemplate :: Maybe LaunchTemplateSpecification
- capacityRebalance :: Maybe Bool
- placementGroup :: Maybe Text
- autoScalingGroupName :: Text
- newUpdateAutoScalingGroup :: Text -> UpdateAutoScalingGroup
- updateAutoScalingGroup_context :: Lens' UpdateAutoScalingGroup (Maybe Text)
- updateAutoScalingGroup_terminationPolicies :: Lens' UpdateAutoScalingGroup (Maybe [Text])
- updateAutoScalingGroup_healthCheckGracePeriod :: Lens' UpdateAutoScalingGroup (Maybe Int)
- updateAutoScalingGroup_serviceLinkedRoleARN :: Lens' UpdateAutoScalingGroup (Maybe Text)
- updateAutoScalingGroup_newInstancesProtectedFromScaleIn :: Lens' UpdateAutoScalingGroup (Maybe Bool)
- updateAutoScalingGroup_vPCZoneIdentifier :: Lens' UpdateAutoScalingGroup (Maybe Text)
- updateAutoScalingGroup_maxInstanceLifetime :: Lens' UpdateAutoScalingGroup (Maybe Int)
- updateAutoScalingGroup_defaultCooldown :: Lens' UpdateAutoScalingGroup (Maybe Int)
- updateAutoScalingGroup_maxSize :: Lens' UpdateAutoScalingGroup (Maybe Int)
- updateAutoScalingGroup_availabilityZones :: Lens' UpdateAutoScalingGroup (Maybe [Text])
- updateAutoScalingGroup_desiredCapacity :: Lens' UpdateAutoScalingGroup (Maybe Int)
- updateAutoScalingGroup_mixedInstancesPolicy :: Lens' UpdateAutoScalingGroup (Maybe MixedInstancesPolicy)
- updateAutoScalingGroup_minSize :: Lens' UpdateAutoScalingGroup (Maybe Int)
- updateAutoScalingGroup_launchConfigurationName :: Lens' UpdateAutoScalingGroup (Maybe Text)
- updateAutoScalingGroup_healthCheckType :: Lens' UpdateAutoScalingGroup (Maybe Text)
- updateAutoScalingGroup_launchTemplate :: Lens' UpdateAutoScalingGroup (Maybe LaunchTemplateSpecification)
- updateAutoScalingGroup_capacityRebalance :: Lens' UpdateAutoScalingGroup (Maybe Bool)
- updateAutoScalingGroup_placementGroup :: Lens' UpdateAutoScalingGroup (Maybe Text)
- updateAutoScalingGroup_autoScalingGroupName :: Lens' UpdateAutoScalingGroup Text
- data UpdateAutoScalingGroupResponse = UpdateAutoScalingGroupResponse' {
- newUpdateAutoScalingGroupResponse :: UpdateAutoScalingGroupResponse
Creating a Request
data UpdateAutoScalingGroup Source #
See: newUpdateAutoScalingGroup
smart constructor.
UpdateAutoScalingGroup' | |
|
Instances
newUpdateAutoScalingGroup Source #
Create a value of UpdateAutoScalingGroup
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:context:UpdateAutoScalingGroup'
, updateAutoScalingGroup_context
- Reserved.
$sel:terminationPolicies:UpdateAutoScalingGroup'
, updateAutoScalingGroup_terminationPolicies
- A policy or a list of policies that are used to select the instances to
terminate. The policies are executed in the order that you list them.
For more information, see
Controlling which Auto Scaling instances terminate during scale in
in the Amazon EC2 Auto Scaling User Guide.
$sel:healthCheckGracePeriod:UpdateAutoScalingGroup'
, updateAutoScalingGroup_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. The default value is 0
. For more information, see
Health check grace period
in the Amazon EC2 Auto Scaling User Guide.
Conditional: Required if you are adding an ELB
health check.
$sel:serviceLinkedRoleARN:UpdateAutoScalingGroup'
, updateAutoScalingGroup_serviceLinkedRoleARN
- The Amazon Resource Name (ARN) of the service-linked role that the Auto
Scaling group uses to call other Amazon Web Services on your behalf. For
more information, see
Service-linked roles
in the Amazon EC2 Auto Scaling User Guide.
$sel:newInstancesProtectedFromScaleIn':UpdateAutoScalingGroup'
, updateAutoScalingGroup_newInstancesProtectedFromScaleIn
- 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
Instance scale-in protection
in the Amazon EC2 Auto Scaling User Guide.
$sel:vPCZoneIdentifier:UpdateAutoScalingGroup'
, updateAutoScalingGroup_vPCZoneIdentifier
- A comma-separated list of subnet IDs for a virtual private cloud (VPC).
If you specify VPCZoneIdentifier
with AvailabilityZones
, the subnets
that you specify for this parameter must reside in those Availability
Zones.
$sel:maxInstanceLifetime:UpdateAutoScalingGroup'
, updateAutoScalingGroup_maxInstanceLifetime
- 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). To clear a
previously set value, specify a new value of 0. For more information,
see
Replacing Auto Scaling instances based on maximum instance lifetime
in the Amazon EC2 Auto Scaling User Guide.
$sel:defaultCooldown:UpdateAutoScalingGroup'
, updateAutoScalingGroup_defaultCooldown
- The amount of time, in seconds, after a scaling activity completes
before another scaling activity can start. The default value is 300
.
This setting applies when using simple scaling policies, but not when
using other scaling policies or scheduled scaling. For more information,
see
Scaling cooldowns for Amazon EC2 Auto Scaling
in the Amazon EC2 Auto Scaling User Guide.
$sel:maxSize:UpdateAutoScalingGroup'
, updateAutoScalingGroup_maxSize
- The maximum size of the Auto Scaling 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).
$sel:availabilityZones:UpdateAutoScalingGroup'
, updateAutoScalingGroup_availabilityZones
- One or more Availability Zones for the group.
$sel:desiredCapacity:UpdateAutoScalingGroup'
, updateAutoScalingGroup_desiredCapacity
- The desired capacity is the initial capacity of the Auto Scaling group
after this operation completes and the capacity it attempts to maintain.
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.
$sel:mixedInstancesPolicy:UpdateAutoScalingGroup'
, updateAutoScalingGroup_mixedInstancesPolicy
- An embedded object that specifies a mixed instances policy. When you
make changes to an existing policy, all optional properties are left
unchanged if not specified. For more information, see
Auto Scaling groups with multiple instance types and purchase options
in the Amazon EC2 Auto Scaling User Guide.
$sel:minSize:UpdateAutoScalingGroup'
, updateAutoScalingGroup_minSize
- The minimum size of the Auto Scaling group.
$sel:launchConfigurationName:UpdateAutoScalingGroup'
, updateAutoScalingGroup_launchConfigurationName
- The name of the launch configuration. If you specify
LaunchConfigurationName
in your update request, you can't specify
LaunchTemplate
or MixedInstancesPolicy
.
$sel:healthCheckType:UpdateAutoScalingGroup'
, updateAutoScalingGroup_healthCheckType
- The service to use for the health checks. The valid values are EC2
and
ELB
. If you configure an Auto Scaling group to use ELB
health
checks, it considers the instance unhealthy if it fails either the EC2
status checks or the load balancer health checks.
$sel:launchTemplate:UpdateAutoScalingGroup'
, updateAutoScalingGroup_launchTemplate
- The launch template and version to use to specify the updates. If you
specify LaunchTemplate
in your update request, you can't specify
LaunchConfigurationName
or MixedInstancesPolicy
.
$sel:capacityRebalance:UpdateAutoScalingGroup'
, updateAutoScalingGroup_capacityRebalance
- Enables or disables Capacity Rebalancing. For more information, see
Amazon EC2 Auto Scaling Capacity Rebalancing
in the Amazon EC2 Auto Scaling User Guide.
$sel:placementGroup:UpdateAutoScalingGroup'
, updateAutoScalingGroup_placementGroup
- The name of an existing placement group into which to launch your
instances, if any. A placement group is a logical grouping of instances
within a single Availability Zone. You cannot specify multiple
Availability Zones and a placement group. For more information, see
Placement Groups
in the Amazon EC2 User Guide for Linux Instances.
$sel:autoScalingGroupName:UpdateAutoScalingGroup'
, updateAutoScalingGroup_autoScalingGroupName
- The name of the Auto Scaling group.
Request Lenses
updateAutoScalingGroup_context :: Lens' UpdateAutoScalingGroup (Maybe Text) Source #
Reserved.
updateAutoScalingGroup_terminationPolicies :: Lens' UpdateAutoScalingGroup (Maybe [Text]) Source #
A policy or a list of policies that are used to select the instances to terminate. The policies are executed in the order that you list them. For more information, see Controlling which Auto Scaling instances terminate during scale in in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_healthCheckGracePeriod :: Lens' UpdateAutoScalingGroup (Maybe Int) Source #
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. The default value is 0
. For more information, see
Health check grace period
in the Amazon EC2 Auto Scaling User Guide.
Conditional: Required if you are adding an ELB
health check.
updateAutoScalingGroup_serviceLinkedRoleARN :: Lens' UpdateAutoScalingGroup (Maybe Text) Source #
The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services on your behalf. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_newInstancesProtectedFromScaleIn :: Lens' UpdateAutoScalingGroup (Maybe Bool) Source #
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 Instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_vPCZoneIdentifier :: Lens' UpdateAutoScalingGroup (Maybe Text) Source #
A comma-separated list of subnet IDs for a virtual private cloud (VPC).
If you specify VPCZoneIdentifier
with AvailabilityZones
, the subnets
that you specify for this parameter must reside in those Availability
Zones.
updateAutoScalingGroup_maxInstanceLifetime :: Lens' UpdateAutoScalingGroup (Maybe Int) Source #
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). To clear a previously set value, specify a new value of 0. For more information, see Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_defaultCooldown :: Lens' UpdateAutoScalingGroup (Maybe Int) Source #
The amount of time, in seconds, after a scaling activity completes
before another scaling activity can start. The default value is 300
.
This setting applies when using simple scaling policies, but not when
using other scaling policies or scheduled scaling. For more information,
see
Scaling cooldowns for Amazon EC2 Auto Scaling
in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_maxSize :: Lens' UpdateAutoScalingGroup (Maybe Int) Source #
The maximum size of the Auto Scaling 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).
updateAutoScalingGroup_availabilityZones :: Lens' UpdateAutoScalingGroup (Maybe [Text]) Source #
One or more Availability Zones for the group.
updateAutoScalingGroup_desiredCapacity :: Lens' UpdateAutoScalingGroup (Maybe Int) Source #
The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain. 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.
updateAutoScalingGroup_mixedInstancesPolicy :: Lens' UpdateAutoScalingGroup (Maybe MixedInstancesPolicy) Source #
An embedded object that specifies a mixed instances policy. When you make changes to an existing policy, all optional properties are left unchanged if not specified. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_minSize :: Lens' UpdateAutoScalingGroup (Maybe Int) Source #
The minimum size of the Auto Scaling group.
updateAutoScalingGroup_launchConfigurationName :: Lens' UpdateAutoScalingGroup (Maybe Text) Source #
The name of the launch configuration. If you specify
LaunchConfigurationName
in your update request, you can't specify
LaunchTemplate
or MixedInstancesPolicy
.
updateAutoScalingGroup_healthCheckType :: Lens' UpdateAutoScalingGroup (Maybe Text) Source #
The service to use for the health checks. The valid values are EC2
and
ELB
. If you configure an Auto Scaling group to use ELB
health
checks, it considers the instance unhealthy if it fails either the EC2
status checks or the load balancer health checks.
updateAutoScalingGroup_launchTemplate :: Lens' UpdateAutoScalingGroup (Maybe LaunchTemplateSpecification) Source #
The launch template and version to use to specify the updates. If you
specify LaunchTemplate
in your update request, you can't specify
LaunchConfigurationName
or MixedInstancesPolicy
.
updateAutoScalingGroup_capacityRebalance :: Lens' UpdateAutoScalingGroup (Maybe Bool) Source #
Enables or disables Capacity Rebalancing. For more information, see Amazon EC2 Auto Scaling Capacity Rebalancing in the Amazon EC2 Auto Scaling User Guide.
updateAutoScalingGroup_placementGroup :: Lens' UpdateAutoScalingGroup (Maybe Text) Source #
The name of an existing placement group into which to launch your instances, if any. A placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a placement group. For more information, see Placement Groups in the Amazon EC2 User Guide for Linux Instances.
updateAutoScalingGroup_autoScalingGroupName :: Lens' UpdateAutoScalingGroup Text Source #
The name of the Auto Scaling group.
Destructuring the Response
data UpdateAutoScalingGroupResponse Source #
See: newUpdateAutoScalingGroupResponse
smart constructor.
Instances
newUpdateAutoScalingGroupResponse :: UpdateAutoScalingGroupResponse Source #
Create a value of UpdateAutoScalingGroupResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.