autoscaling_update_auto_scaling_group: We strongly recommend that all Auto Scaling groups use launch...

Description Usage Arguments Value Request syntax Examples

View source: R/autoscaling_operations.R

Description

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:

To see which parameters have been set, call the describe_auto_scaling_groups API. To view the scaling policies for an Auto Scaling group, call the describe_policies API. If the group has scaling policies, you can update them by calling the put_scaling_policy API.

Usage

1
2
3
4
5
6
7
autoscaling_update_auto_scaling_group(AutoScalingGroupName,
  LaunchConfigurationName, LaunchTemplate, MixedInstancesPolicy, MinSize,
  MaxSize, DesiredCapacity, DefaultCooldown, AvailabilityZones,
  HealthCheckType, HealthCheckGracePeriod, PlacementGroup,
  VPCZoneIdentifier, TerminationPolicies,
  NewInstancesProtectedFromScaleIn, ServiceLinkedRoleARN,
  MaxInstanceLifetime, CapacityRebalance)

Arguments

AutoScalingGroupName

[required] The name of the Auto Scaling group.

LaunchConfigurationName

The name of the launch configuration. If you specify LaunchConfigurationName in your update request, you can't specify LaunchTemplate or MixedInstancesPolicy.

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.

MixedInstancesPolicy

An embedded object that specifies a mixed instances policy. When you make changes to an existing policy, all optional parameters 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.

MinSize

The minimum size of the Auto Scaling group.

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).

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.

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.

AvailabilityZones

One or more Availability Zones for the group.

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.

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.

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.

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.

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.

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.

ServiceLinkedRoleARN

The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.

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.

CapacityRebalance

Enables or disables Capacity Rebalancing. For more information, see Amazon EC2 Auto Scaling Capacity Rebalancing in the Amazon EC2 Auto Scaling User Guide.

Value

An empty list.

Request syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
svc$update_auto_scaling_group(
  AutoScalingGroupName = "string",
  LaunchConfigurationName = "string",
  LaunchTemplate = list(
    LaunchTemplateId = "string",
    LaunchTemplateName = "string",
    Version = "string"
  ),
  MixedInstancesPolicy = list(
    LaunchTemplate = list(
      LaunchTemplateSpecification = list(
        LaunchTemplateId = "string",
        LaunchTemplateName = "string",
        Version = "string"
      ),
      Overrides = list(
        list(
          InstanceType = "string",
          WeightedCapacity = "string",
          LaunchTemplateSpecification = list(
            LaunchTemplateId = "string",
            LaunchTemplateName = "string",
            Version = "string"
          )
        )
      )
    ),
    InstancesDistribution = list(
      OnDemandAllocationStrategy = "string",
      OnDemandBaseCapacity = 123,
      OnDemandPercentageAboveBaseCapacity = 123,
      SpotAllocationStrategy = "string",
      SpotInstancePools = 123,
      SpotMaxPrice = "string"
    )
  ),
  MinSize = 123,
  MaxSize = 123,
  DesiredCapacity = 123,
  DefaultCooldown = 123,
  AvailabilityZones = list(
    "string"
  ),
  HealthCheckType = "string",
  HealthCheckGracePeriod = 123,
  PlacementGroup = "string",
  VPCZoneIdentifier = "string",
  TerminationPolicies = list(
    "string"
  ),
  NewInstancesProtectedFromScaleIn = TRUE|FALSE,
  ServiceLinkedRoleARN = "string",
  MaxInstanceLifetime = 123,
  CapacityRebalance = TRUE|FALSE
)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
# This example updates the launch configuration of the specified Auto
# Scaling group.
svc$update_auto_scaling_group(
  AutoScalingGroupName = "my-auto-scaling-group",
  LaunchConfigurationName = "new-launch-config"
)

# This example updates the minimum size and maximum size of the specified
# Auto Scaling group.
svc$update_auto_scaling_group(
  AutoScalingGroupName = "my-auto-scaling-group",
  MaxSize = 3L,
  MinSize = 1L
)

# This example enables instance protection for the specified Auto Scaling
# group.
svc$update_auto_scaling_group(
  AutoScalingGroupName = "my-auto-scaling-group",
  NewInstancesProtectedFromScaleIn = TRUE
)

## End(Not run)

paws.management documentation built on Aug. 23, 2021, 9:11 a.m.