Class: Aws::AutoScaling::AutoScalingGroup

Inherits:
Object
  • Object
show all
Extended by:
Deprecations
Defined in:
sig/auto_scaling_group.rbs,
lib/aws-sdk-autoscaling/auto_scaling_group.rb

Overview

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Actions collapse

Associations collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ AutoScalingGroup #initialize(options = {}) ⇒ AutoScalingGroup

Returns a new instance of AutoScalingGroup.

Overloads:

  • #initialize(name, options = {}) ⇒ AutoScalingGroup

    Parameters:

    • name (String)

    Options Hash (options):

  • #initialize(options = {}) ⇒ AutoScalingGroup

    Options Hash (options):

    • :name (required, String)
    • :client (Client)


13
14
15
# File 'sig/auto_scaling_group.rbs', line 13

def initialize: (String name, Hash[Symbol, untyped] options) -> void
| (name: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void

Instance Method Details

#activities(options = {}) ⇒ Activity::Collection

Examples:

Request syntax with placeholder values


activities = auto_scaling_group.activities({
  activity_ids: ["XmlString"],
  include_deleted_groups: false,
  filters: [
    {
      name: "XmlString",
      values: ["XmlString"],
    },
  ],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :activity_ids (Array<String>)

    The activity IDs of the desired scaling activities. If unknown activity IDs are requested, they are ignored with no error. Only activities started within the last six weeks can be returned regardless of the activity IDs specified. If other filters are specified with the request, only results matching all filter criteria can be returned.

    Array Members: Maximum number of 50 IDs.

  • :include_deleted_groups (Boolean)

    Indicates whether to include scaling activity from deleted Auto Scaling groups.

  • :filters (Array<Types::Filter>)

    One or more filters to limit the results based on specific criteria. The following filters are supported:

    • StartTimeLowerBound - The earliest scaling activities to return based on the activity start time. Scaling activities with a start time earlier than this value are not included in the results. Only activities started within the last six weeks can be returned regardless of the value specified.

    • StartTimeUpperBound - The latest scaling activities to return based on the activity start time. Scaling activities with a start time later than this value are not included in the results. Only activities started within the last six weeks can be returned regardless of the value specified.

    • Status - The StatusCode value of the scaling activity. This filter can only be used in combination with the AutoScalingGroupName parameter. For valid StatusCode values, see Activity in the Amazon EC2 Auto Scaling API Reference.

    StartTimeLowerBound and StartTimeUpperBound accept ISO 8601 formatted timestamps. Timestamps without a timezone offset are assumed to be UTC.

    • 2000-01-18T08:15:00Z

    • 2000-01-18T16:15:00+08:00

Returns:



536
# File 'sig/auto_scaling_group.rbs', line 536

def activities: (

#attach_instances(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.attach_instances({
  instance_ids: ["XmlStringMaxLen19"],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :instance_ids (Array<String>)

    The IDs of the instances. You can specify up to 20 instances.

Returns:

  • (EmptyStructure)


164
# File 'sig/auto_scaling_group.rbs', line 164

def attach_instances: (

#auto_scaling_group_arnString

The Amazon Resource Name (ARN) of the Auto Scaling group.

Returns:

  • (String)


22
# File 'sig/auto_scaling_group.rbs', line 22

def auto_scaling_group_arn: () -> ::String

#availability_zone_distributionTypes::AvailabilityZoneDistribution

The EC2 instance capacity distribution across Availability Zones for the Auto Scaling group.



124
# File 'sig/auto_scaling_group.rbs', line 124

def availability_zone_distribution: () -> Types::AvailabilityZoneDistribution

#availability_zone_idsArray<String>

The Availability Zone IDs where the Auto Scaling group can launch instances.

Returns:

  • (Array<String>)


52
# File 'sig/auto_scaling_group.rbs', line 52

def availability_zone_ids: () -> ::Array[::String]

#availability_zone_impairment_policyTypes::AvailabilityZoneImpairmentPolicy

The Availability Zone impairment policy for the Auto Scaling group.



127
# File 'sig/auto_scaling_group.rbs', line 127

def availability_zone_impairment_policy: () -> Types::AvailabilityZoneImpairmentPolicy

#availability_zonesArray<String>

One or more Availability Zones for the Auto Scaling group.

Returns:

  • (Array<String>)


49
# File 'sig/auto_scaling_group.rbs', line 49

def availability_zones: () -> ::Array[::String]

#capacity_rebalanceBoolean

Indicates whether Capacity Rebalancing is enabled.

Returns:

  • (Boolean)


97
# File 'sig/auto_scaling_group.rbs', line 97

def capacity_rebalance: () -> bool

#capacity_reservation_specificationTypes::CapacityReservationSpecification

The capacity reservation specification for the Auto Scaling group.



130
# File 'sig/auto_scaling_group.rbs', line 130

def capacity_reservation_specification: () -> Types::CapacityReservationSpecification

#clientClient

Returns:



298
# File 'lib/aws-sdk-autoscaling/auto_scaling_group.rb', line 298

def client: () -> Client

#contextString

Reserved.

Returns:

  • (String)


106
# File 'sig/auto_scaling_group.rbs', line 106

def context: () -> ::String

#created_timeTime

The date and time the Auto Scaling group was created.

Returns:

  • (Time)


67
# File 'sig/auto_scaling_group.rbs', line 67

def created_time: () -> ::Time

#dataTypes::AutoScalingGroup



142
# File 'sig/auto_scaling_group.rbs', line 142

def data: () -> Types::AutoScalingGroup

#data_loaded?Boolean

Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



145
# File 'sig/auto_scaling_group.rbs', line 145

def data_loaded?: () -> bool

#default_cooldownInteger

The duration of the default cooldown period, in seconds, for the Auto Scaling group.

Returns:

  • (Integer)


46
# File 'sig/auto_scaling_group.rbs', line 46

def default_cooldown: () -> ::Integer

#default_instance_warmupInteger

The duration of the default EC2 instance warmup time, in seconds, for the Auto Scaling group.

Returns:

  • (Integer)


112
# File 'sig/auto_scaling_group.rbs', line 112

def default_instance_warmup: () -> ::Integer

#delete(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.delete({
  force_delete: false,
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :force_delete (Boolean)

    Specifies that the group is to be deleted along with all instances associated with the group, without waiting for all instances to be terminated. This action also deletes any outstanding lifecycle actions associated with the group.

Returns:

  • (EmptyStructure)


170
# File 'sig/auto_scaling_group.rbs', line 170

def delete: (

#deletion_protectionString

The deletion protection setting for the Auto Scaling group.

Returns:

  • (String)


121
# File 'sig/auto_scaling_group.rbs', line 121

def deletion_protection: () -> ("none" | "prevent-force-deletion" | "prevent-all-deletion")

#desired_capacityInteger

The desired size of the Auto Scaling group.

Returns:

  • (Integer)


40
# File 'sig/auto_scaling_group.rbs', line 40

def desired_capacity: () -> ::Integer

#desired_capacity_typeString

The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only.

Returns:

  • (String)


109
# File 'sig/auto_scaling_group.rbs', line 109

def desired_capacity_type: () -> ::String

#detach_instances(options = {}) ⇒ Activity::Collection

Examples:

Request syntax with placeholder values


activity = auto_scaling_group.detach_instances({
  instance_ids: ["XmlStringMaxLen19"],
  should_decrement_desired_capacity: false, # required
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :instance_ids (Array<String>)

    The IDs of the instances. You can specify up to 20 instances.

  • :should_decrement_desired_capacity (required, Boolean)

    Indicates whether the Auto Scaling group decrements the desired capacity value by the number of instances detached.

Returns:



176
# File 'sig/auto_scaling_group.rbs', line 176

def detach_instances: (

#disable_metrics_collection(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.disable_metrics_collection({
  metrics: ["XmlStringMaxLen255"],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :metrics (Array<String>)

    Identifies the metrics to disable.

    You can specify one or more of the following metrics:

    • GroupMinSize

    • GroupMaxSize

    • GroupDesiredCapacity

    • GroupInServiceInstances

    • GroupPendingInstances

    • GroupStandbyInstances

    • GroupTerminatingInstances

    • GroupTotalInstances

    • GroupInServiceCapacity

    • GroupPendingCapacity

    • GroupStandbyCapacity

    • GroupTerminatingCapacity

    • GroupTotalCapacity

    • WarmPoolDesiredCapacity

    • WarmPoolWarmedCapacity

    • WarmPoolPendingCapacity

    • WarmPoolTerminatingCapacity

    • WarmPoolTotalCapacity

    • GroupAndWarmPoolDesiredCapacity

    • GroupAndWarmPoolTotalCapacity

    If you omit this property, all metrics are disabled.

    For more information, see Amazon CloudWatch metrics for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

Returns:

  • (EmptyStructure)


183
# File 'sig/auto_scaling_group.rbs', line 183

def disable_metrics_collection: (

#enable_metrics_collection(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.enable_metrics_collection({
  metrics: ["XmlStringMaxLen255"],
  granularity: "XmlStringMaxLen255", # required
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :metrics (Array<String>)

    Identifies the metrics to enable.

    You can specify one or more of the following metrics:

    • GroupMinSize

    • GroupMaxSize

    • GroupDesiredCapacity

    • GroupInServiceInstances

    • GroupPendingInstances

    • GroupStandbyInstances

    • GroupTerminatingInstances

    • GroupTotalInstances

    • GroupInServiceCapacity

    • GroupPendingCapacity

    • GroupStandbyCapacity

    • GroupTerminatingCapacity

    • GroupTotalCapacity

    • WarmPoolDesiredCapacity

    • WarmPoolWarmedCapacity

    • WarmPoolPendingCapacity

    • WarmPoolTerminatingCapacity

    • WarmPoolTotalCapacity

    • GroupAndWarmPoolDesiredCapacity

    • GroupAndWarmPoolTotalCapacity

    If you specify Granularity and don't specify any metrics, all metrics are enabled.

    For more information, see Amazon CloudWatch metrics for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

  • :granularity (required, String)

    The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is 1Minute.

Returns:

  • (EmptyStructure)


189
# File 'sig/auto_scaling_group.rbs', line 189

def enable_metrics_collection: (

#enabled_metricsArray<Types::EnabledMetric>

The metrics enabled for the Auto Scaling group.

Returns:



79
# File 'sig/auto_scaling_group.rbs', line 79

def enabled_metrics: () -> ::Array[Types::EnabledMetric]

#exists?(options = {}) ⇒ Boolean

Returns true if the AutoScalingGroup exists.

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Returns:

  • (Boolean)

    Returns true if the AutoScalingGroup exists.



148
149
# File 'sig/auto_scaling_group.rbs', line 148

def exists?: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) -> bool
| (?Hash[Symbol, untyped]) -> bool

#health_check_grace_periodInteger

The duration of the health check grace period, in seconds, for the Auto Scaling group.

Returns:

  • (Integer)


64
# File 'sig/auto_scaling_group.rbs', line 64

def health_check_grace_period: () -> ::Integer

#health_check_typeString

One or more comma-separated health check types for the Auto Scaling group.

Returns:

  • (String)


61
# File 'sig/auto_scaling_group.rbs', line 61

def health_check_type: () -> ::String

#identifiersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.


1950
1951
1952
# File 'lib/aws-sdk-autoscaling/auto_scaling_group.rb', line 1950

def identifiers
  { name: @name }
end

#instance_lifecycle_policyTypes::InstanceLifecyclePolicy

The instance lifecycle policy for the Auto Scaling group.



133
# File 'sig/auto_scaling_group.rbs', line 133

def instance_lifecycle_policy: () -> Types::InstanceLifecyclePolicy

#instance_maintenance_policyTypes::InstanceMaintenancePolicy

An instance maintenance policy.



118
# File 'sig/auto_scaling_group.rbs', line 118

def instance_maintenance_policy: () -> Types::InstanceMaintenancePolicy

#instancesInstance::Collection



549
# File 'sig/auto_scaling_group.rbs', line 549

def instances: () -> Instance::Collection

#launch_configurationLaunchConfiguration?

Returns:



552
# File 'sig/auto_scaling_group.rbs', line 552

def launch_configuration: () -> LaunchConfiguration?

#launch_configuration_nameString

The name of the associated launch configuration for the Auto Scaling group.

Returns:

  • (String)


25
# File 'sig/auto_scaling_group.rbs', line 25

def launch_configuration_name: () -> ::String

#launch_templateTypes::LaunchTemplateSpecification

The launch template for the Auto Scaling group.



28
# File 'sig/auto_scaling_group.rbs', line 28

def launch_template: () -> Types::LaunchTemplateSpecification

#lifecycle_hook(name) ⇒ LifecycleHook

Parameters:

  • name (String)

Returns:



555
# File 'sig/auto_scaling_group.rbs', line 555

def lifecycle_hook: (String name) -> LifecycleHook

#lifecycle_hooks(options = {}) ⇒ LifecycleHook::Collection

Examples:

Request syntax with placeholder values


lifecycle_hooks = auto_scaling_group.lifecycle_hooks({
  lifecycle_hook_names: ["AsciiStringMaxLen255"],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :lifecycle_hook_names (Array<String>)

    The names of one or more lifecycle hooks. If you omit this property, all lifecycle hooks are described.

Returns:



558
# File 'sig/auto_scaling_group.rbs', line 558

def lifecycle_hooks: (

#loadself Also known as: reload

Loads, or reloads #data for the current Aws::AutoScaling::AutoScalingGroup. Returns self making it possible to chain methods.

auto_scaling_group.reload.data

Returns:

  • (self)


138
# File 'sig/auto_scaling_group.rbs', line 138

def load: () -> self

#load_balancer(name) ⇒ LoadBalancer

Parameters:

  • name (String)

Returns:



564
# File 'sig/auto_scaling_group.rbs', line 564

def load_balancer: (String name) -> LoadBalancer

#load_balancer_namesArray<String>

One or more load balancers associated with the group.

Returns:

  • (Array<String>)


55
# File 'sig/auto_scaling_group.rbs', line 55

def load_balancer_names: () -> ::Array[::String]

#load_balancers(options = {}) ⇒ LoadBalancer::Collection

Examples:

Request syntax with placeholder values


auto_scaling_group.load_balancers()

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Returns:



567
# File 'sig/auto_scaling_group.rbs', line 567

def load_balancers: (

#max_instance_lifetimeInteger

The maximum amount of time, in seconds, that an EC2 instance can be in service for the Auto Scaling group.

Returns:

  • (Integer)


94
# File 'sig/auto_scaling_group.rbs', line 94

def max_instance_lifetime: () -> ::Integer

#max_sizeInteger

The maximum size of the Auto Scaling group.

Returns:

  • (Integer)


37
# File 'sig/auto_scaling_group.rbs', line 37

def max_size: () -> ::Integer

#min_sizeInteger

The minimum size of the Auto Scaling group.

Returns:

  • (Integer)


34
# File 'sig/auto_scaling_group.rbs', line 34

def min_size: () -> ::Integer

#mixed_instances_policyTypes::MixedInstancesPolicy

The mixed instances policy for the group.



31
# File 'sig/auto_scaling_group.rbs', line 31

def mixed_instances_policy: () -> Types::MixedInstancesPolicy

#nameString Also known as: auto_scaling_group_name

Returns:

  • (String)


18
# File 'sig/auto_scaling_group.rbs', line 18

def name: () -> String

#new_instances_protected_from_scale_inBoolean

Indicates whether newly launched EC2 instances are protected from termination when scaling in for the Auto Scaling group.

For more information about preventing instances from terminating on scale in, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.

Returns:

  • (Boolean)


88
# File 'sig/auto_scaling_group.rbs', line 88

def new_instances_protected_from_scale_in: () -> bool

#notification_configurations(options = {}) ⇒ NotificationConfiguration::Collection

Examples:

Request syntax with placeholder values


auto_scaling_group.notification_configurations()

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Returns:



572
# File 'sig/auto_scaling_group.rbs', line 572

def notification_configurations: (

#placement_groupString

The name of the placement group into which to launch EC2 instances for the Auto Scaling group.

Returns:

  • (String)


73
# File 'sig/auto_scaling_group.rbs', line 73

def placement_group: () -> ::String

#policies(options = {}) ⇒ ScalingPolicy::Collection

Examples:

Request syntax with placeholder values


policies = auto_scaling_group.policies({
  policy_names: ["ResourceName"],
  policy_types: ["XmlStringMaxLen64"],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :policy_names (Array<String>)

    The names of one or more policies. If you omit this property, all policies are described. If a group name is provided, the results are limited to that group. If you specify an unknown policy name, it is ignored with no error.

    Array Members: Maximum number of 50 items.

  • :policy_types (Array<String>)

    One or more policy types. The valid values are SimpleScaling, StepScaling, TargetTrackingScaling, and PredictiveScaling.

Returns:



577
# File 'sig/auto_scaling_group.rbs', line 577

def policies: (

#predicted_capacityInteger

The predicted capacity of the group when it has a predictive scaling policy.

Returns:

  • (Integer)


43
# File 'sig/auto_scaling_group.rbs', line 43

def predicted_capacity: () -> ::Integer

#put_scaling_policy(options = {}) ⇒ ScalingPolicy

Examples:

Request syntax with placeholder values


scalingpolicy = auto_scaling_group.put_scaling_policy({
  policy_name: "XmlStringMaxLen255", # required
  policy_type: "XmlStringMaxLen64",
  adjustment_type: "XmlStringMaxLen255",
  min_adjustment_step: 1,
  min_adjustment_magnitude: 1,
  scaling_adjustment: 1,
  cooldown: 1,
  metric_aggregation_type: "XmlStringMaxLen32",
  step_adjustments: [
    {
      metric_interval_lower_bound: 1.0,
      metric_interval_upper_bound: 1.0,
      scaling_adjustment: 1, # required
    },
  ],
  estimated_instance_warmup: 1,
  target_tracking_configuration: {
    predefined_metric_specification: {
      predefined_metric_type: "ASGAverageCPUUtilization", # required, accepts ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, ALBRequestCountPerTarget
      resource_label: "XmlStringMaxLen1023",
    },
    customized_metric_specification: {
      metric_name: "MetricName",
      namespace: "MetricNamespace",
      dimensions: [
        {
          name: "MetricDimensionName", # required
          value: "MetricDimensionValue", # required
        },
      ],
      statistic: "Average", # accepts Average, Minimum, Maximum, SampleCount, Sum
      unit: "MetricUnit",
      period: 1,
      metrics: [
        {
          id: "XmlStringMaxLen64", # required
          expression: "XmlStringMaxLen2047",
          metric_stat: {
            metric: { # required
              namespace: "MetricNamespace", # required
              metric_name: "MetricName", # required
              dimensions: [
                {
                  name: "MetricDimensionName", # required
                  value: "MetricDimensionValue", # required
                },
              ],
            },
            stat: "XmlStringMetricStat", # required
            unit: "MetricUnit",
            period: 1,
          },
          label: "XmlStringMetricLabel",
          period: 1,
          return_data: false,
        },
      ],
    },
    target_value: 1.0, # required
    disable_scale_in: false,
  },
  enabled: false,
  predictive_scaling_configuration: {
    metric_specifications: [ # required
      {
        target_value: 1.0, # required
        predefined_metric_pair_specification: {
          predefined_metric_type: "ASGCPUUtilization", # required, accepts ASGCPUUtilization, ASGNetworkIn, ASGNetworkOut, ALBRequestCount
          resource_label: "XmlStringMaxLen1023",
        },
        predefined_scaling_metric_specification: {
          predefined_metric_type: "ASGAverageCPUUtilization", # required, accepts ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut, ALBRequestCountPerTarget
          resource_label: "XmlStringMaxLen1023",
        },
        predefined_load_metric_specification: {
          predefined_metric_type: "ASGTotalCPUUtilization", # required, accepts ASGTotalCPUUtilization, ASGTotalNetworkIn, ASGTotalNetworkOut, ALBTargetGroupRequestCount
          resource_label: "XmlStringMaxLen1023",
        },
        customized_scaling_metric_specification: {
          metric_data_queries: [ # required
            {
              id: "XmlStringMaxLen255", # required
              expression: "XmlStringMaxLen1023",
              metric_stat: {
                metric: { # required
                  namespace: "MetricNamespace", # required
                  metric_name: "MetricName", # required
                  dimensions: [
                    {
                      name: "MetricDimensionName", # required
                      value: "MetricDimensionValue", # required
                    },
                  ],
                },
                stat: "XmlStringMetricStat", # required
                unit: "MetricUnit",
              },
              label: "XmlStringMetricLabel",
              return_data: false,
            },
          ],
        },
        customized_load_metric_specification: {
          metric_data_queries: [ # required
            {
              id: "XmlStringMaxLen255", # required
              expression: "XmlStringMaxLen1023",
              metric_stat: {
                metric: { # required
                  namespace: "MetricNamespace", # required
                  metric_name: "MetricName", # required
                  dimensions: [
                    {
                      name: "MetricDimensionName", # required
                      value: "MetricDimensionValue", # required
                    },
                  ],
                },
                stat: "XmlStringMetricStat", # required
                unit: "MetricUnit",
              },
              label: "XmlStringMetricLabel",
              return_data: false,
            },
          ],
        },
        customized_capacity_metric_specification: {
          metric_data_queries: [ # required
            {
              id: "XmlStringMaxLen255", # required
              expression: "XmlStringMaxLen1023",
              metric_stat: {
                metric: { # required
                  namespace: "MetricNamespace", # required
                  metric_name: "MetricName", # required
                  dimensions: [
                    {
                      name: "MetricDimensionName", # required
                      value: "MetricDimensionValue", # required
                    },
                  ],
                },
                stat: "XmlStringMetricStat", # required
                unit: "MetricUnit",
              },
              label: "XmlStringMetricLabel",
              return_data: false,
            },
          ],
        },
      },
    ],
    mode: "ForecastAndScale", # accepts ForecastAndScale, ForecastOnly
    scheduling_buffer_time: 1,
    max_capacity_breach_behavior: "HonorMaxCapacity", # accepts HonorMaxCapacity, IncreaseMaxCapacity
    max_capacity_buffer: 1,
  },
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy.

  • :policy_type (String)

    One of the following policy types:

    • TargetTrackingScaling

    • StepScaling

    • SimpleScaling (default)

    • PredictiveScaling

  • :adjustment_type (String)

    Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

    Required if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.

  • :min_adjustment_step (Integer)

    Available for backward compatibility. Use MinAdjustmentMagnitude instead.

  • :min_adjustment_magnitude (Integer)

    The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.

    Valid only if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.

    Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude to a value that is at least as large as your largest instance weight.

  • :scaling_adjustment (Integer)

    The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value.

    Required if the policy type is SimpleScaling. (Not used with any other policy type.)

  • :cooldown (Integer)

    A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown.

    Valid only if the policy type is SimpleScaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

    Default: None

  • :metric_aggregation_type (String)

    The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average.

    Valid only if the policy type is StepScaling.

  • :step_adjustments (Array<Types::StepAdjustment>)

    A set of adjustments that enable you to scale based on the size of the alarm breach.

    Required if the policy type is StepScaling. (Not used with any other policy type.)

  • :estimated_instance_warmup (Integer)

    Not needed if the default instance warmup is defined for the group.

    The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup.

    Valid only if the policy type is TargetTrackingScaling or StepScaling.

    The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then EstimatedInstanceWarmup falls back to the value of default cooldown.

  • :target_tracking_configuration (Types::TargetTrackingConfiguration)

    A target tracking scaling policy. Provides support for predefined or custom metrics.

    The following predefined metrics are available:

    • ASGAverageCPUUtilization

    • ASGAverageNetworkIn

    • ASGAverageNetworkOut

    • ALBRequestCountPerTarget

    If you specify ALBRequestCountPerTarget for the metric, you must specify the ResourceLabel property with the PredefinedMetricSpecification.

    For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference.

    Required if the policy type is TargetTrackingScaling.

  • :enabled (Boolean)

    Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disable a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.

  • :predictive_scaling_configuration (Types::PredictiveScalingConfiguration)

    A predictive scaling policy. Provides support for predefined and custom metrics.

    Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count.

    For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference.

    Required if the policy type is PredictiveScaling.

Returns:



196
# File 'sig/auto_scaling_group.rbs', line 196

def put_scaling_policy: (

#put_scheduled_update_group_action(options = {}) ⇒ ScheduledAction

Examples:

Request syntax with placeholder values


scheduledaction = auto_scaling_group.put_scheduled_update_group_action({
  scheduled_action_name: "XmlStringMaxLen255", # required
  time: Time.now,
  start_time: Time.now,
  end_time: Time.now,
  recurrence: "XmlStringMaxLen255",
  min_size: 1,
  max_size: 1,
  desired_capacity: 1,
  time_zone: "XmlStringMaxLen255",
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :scheduled_action_name (required, String)

    The name of this scaling action.

  • :time (Time, DateTime, Date, Integer, String)

    This property is no longer used.

  • :start_time (Time, DateTime, Date, Integer, String)

    The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, "2021-06-01T00:00:00Z").

    If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.

  • :end_time (Time, DateTime, Date, Integer, String)

    The date and time for the recurring schedule to end, in UTC. For example, "2021-06-01T00:00:00Z".

  • :recurrence (String)

    The recurring schedule for this action. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *"). For more information about this format, see Crontab.

    When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action starts and stops.

    Cron expressions use Universal Coordinated Time (UTC) by default.

  • :min_size (Integer)

    The minimum size of the Auto Scaling group.

  • :max_size (Integer)

    The maximum size of the Auto Scaling group.

  • :desired_capacity (Integer)

    The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions.

    You must specify at least one of the following properties: MaxSize, MinSize, or DesiredCapacity.

  • :time_zone (String)

    Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default.

    Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as Etc/GMT+9 or Pacific/Tahiti). For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

Returns:



358
# File 'sig/auto_scaling_group.rbs', line 358

def put_scheduled_update_group_action: (

#resume_processes(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.resume_processes({
  scaling_processes: ["XmlStringMaxLen255"],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :scaling_processes (Array<String>)

    One or more of the following processes:

    • Launch

    • Terminate

    • AddToLoadBalancer

    • AlarmNotification

    • AZRebalance

    • HealthCheck

    • InstanceRefresh

    • ReplaceUnhealthy

    • ScheduledActions

    If you omit this property, all processes are specified.

Returns:

  • (EmptyStructure)


372
# File 'sig/auto_scaling_group.rbs', line 372

def resume_processes: (

#scheduled_actions(options = {}) ⇒ ScheduledAction::Collection

Examples:

Request syntax with placeholder values


scheduled_actions = auto_scaling_group.scheduled_actions({
  scheduled_action_names: ["XmlStringMaxLen255"],
  start_time: Time.now,
  end_time: Time.now,
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :scheduled_action_names (Array<String>)

    The names of one or more scheduled actions. If you omit this property, all scheduled actions are described. If you specify an unknown scheduled action, it is ignored with no error.

    Array Members: Maximum number of 50 actions.

  • :start_time (Time, DateTime, Date, Integer, String)

    The earliest scheduled start time to return. If scheduled action names are provided, this property is ignored.

  • :end_time (Time, DateTime, Date, Integer, String)

    The latest scheduled start time to return. If scheduled action names are provided, this property is ignored.

Returns:



584
# File 'sig/auto_scaling_group.rbs', line 584

def scheduled_actions: (

#service_linked_role_arnString

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.

Returns:

  • (String)


91
# File 'sig/auto_scaling_group.rbs', line 91

def service_linked_role_arn: () -> ::String

#set_desired_capacity(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.set_desired_capacity({
  desired_capacity: 1, # required
  honor_cooldown: false,
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :desired_capacity (required, Integer)

    The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain.

  • :honor_cooldown (Boolean)

    Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity. By default, Amazon EC2 Auto Scaling does not honor the cooldown period during manual scaling activities.

Returns:

  • (EmptyStructure)


378
# File 'sig/auto_scaling_group.rbs', line 378

def set_desired_capacity: (

#statusString

The current state of the Auto Scaling group when the DeleteAutoScalingGroup operation is in progress.

Returns:

  • (String)


82
# File 'sig/auto_scaling_group.rbs', line 82

def status: () -> ::String

#suspend_processes(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


auto_scaling_group.suspend_processes({
  scaling_processes: ["XmlStringMaxLen255"],
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :scaling_processes (Array<String>)

    One or more of the following processes:

    • Launch

    • Terminate

    • AddToLoadBalancer

    • AlarmNotification

    • AZRebalance

    • HealthCheck

    • InstanceRefresh

    • ReplaceUnhealthy

    • ScheduledActions

    If you omit this property, all processes are specified.

Returns:

  • (EmptyStructure)


385
# File 'sig/auto_scaling_group.rbs', line 385

def suspend_processes: (

#suspended_processesArray<Types::SuspendedProcess>

The suspended processes associated with the Auto Scaling group.

Returns:



70
# File 'sig/auto_scaling_group.rbs', line 70

def suspended_processes: () -> ::Array[Types::SuspendedProcess]

#tag(key) ⇒ Tag

Parameters:

  • key (String)

Returns:



592
# File 'sig/auto_scaling_group.rbs', line 592

def tag: (String key) -> Tag

#tagsTag::Collection

Returns:



595
# File 'sig/auto_scaling_group.rbs', line 595

def tags: () -> Tag::Collection

#target_group_arnsArray<String>

The Amazon Resource Names (ARN) of the target groups for your load balancer.

Returns:

  • (Array<String>)


58
# File 'sig/auto_scaling_group.rbs', line 58

def target_group_arns: () -> ::Array[::String]

#termination_policiesArray<String>

The termination policies for the Auto Scaling group.

Returns:

  • (Array<String>)


85
# File 'sig/auto_scaling_group.rbs', line 85

def termination_policies: () -> ::Array[::String]

#traffic_sourcesArray<Types::TrafficSourceIdentifier>

The traffic sources associated with this Auto Scaling group.

Returns:



115
# File 'sig/auto_scaling_group.rbs', line 115

def traffic_sources: () -> ::Array[Types::TrafficSourceIdentifier]

#update(options = {}) ⇒ AutoScalingGroup

Examples:

Request syntax with placeholder values


autoscalinggroup = auto_scaling_group.update({
  launch_configuration_name: "XmlStringMaxLen255",
  launch_template: {
    launch_template_id: "XmlStringMaxLen255",
    launch_template_name: "LaunchTemplateName",
    version: "XmlStringMaxLen255",
  },
  mixed_instances_policy: {
    launch_template: {
      launch_template_specification: {
        launch_template_id: "XmlStringMaxLen255",
        launch_template_name: "LaunchTemplateName",
        version: "XmlStringMaxLen255",
      },
      overrides: [
        {
          instance_type: "XmlStringMaxLen255",
          weighted_capacity: "XmlStringMaxLen32",
          launch_template_specification: {
            launch_template_id: "XmlStringMaxLen255",
            launch_template_name: "LaunchTemplateName",
            version: "XmlStringMaxLen255",
          },
          instance_requirements: {
            v_cpu_count: { # required
              min: 1, # required
              max: 1,
            },
            memory_mi_b: { # required
              min: 1, # required
              max: 1,
            },
            cpu_manufacturers: ["intel"], # accepts intel, amd, amazon-web-services, apple
            memory_gi_b_per_v_cpu: {
              min: 1.0,
              max: 1.0,
            },
            excluded_instance_types: ["ExcludedInstance"],
            instance_generations: ["current"], # accepts current, previous
            spot_max_price_percentage_over_lowest_price: 1,
            max_spot_price_as_percentage_of_optimal_on_demand_price: 1,
            on_demand_max_price_percentage_over_lowest_price: 1,
            bare_metal: "included", # accepts included, excluded, required
            burstable_performance: "included", # accepts included, excluded, required
            require_hibernate_support: false,
            network_interface_count: {
              min: 1,
              max: 1,
            },
            local_storage: "included", # accepts included, excluded, required
            local_storage_types: ["hdd"], # accepts hdd, ssd
            total_local_storage_gb: {
              min: 1.0,
              max: 1.0,
            },
            baseline_ebs_bandwidth_mbps: {
              min: 1,
              max: 1,
            },
            accelerator_types: ["gpu"], # accepts gpu, fpga, inference
            accelerator_count: {
              min: 1,
              max: 1,
            },
            accelerator_manufacturers: ["nvidia"], # accepts nvidia, amd, amazon-web-services, xilinx
            accelerator_names: ["a100"], # accepts a100, v100, k80, t4, m60, radeon-pro-v520, vu9p
            accelerator_total_memory_mi_b: {
              min: 1,
              max: 1,
            },
            network_bandwidth_gbps: {
              min: 1.0,
              max: 1.0,
            },
            allowed_instance_types: ["AllowedInstanceType"],
            baseline_performance_factors: {
              cpu: {
                references: [
                  {
                    instance_family: "String",
                  },
                ],
              },
            },
          },
          image_id: "ImageId",
        },
      ],
    },
    instances_distribution: {
      on_demand_allocation_strategy: "XmlString",
      on_demand_base_capacity: 1,
      on_demand_percentage_above_base_capacity: 1,
      spot_allocation_strategy: "XmlString",
      spot_instance_pools: 1,
      spot_max_price: "MixedInstanceSpotPrice",
    },
  },
  min_size: 1,
  max_size: 1,
  desired_capacity: 1,
  default_cooldown: 1,
  availability_zones: ["XmlStringMaxLen255"],
  availability_zone_ids: ["XmlStringMaxLen255"],
  health_check_type: "XmlStringMaxLen32",
  health_check_grace_period: 1,
  placement_group: "UpdatePlacementGroupParam",
  vpc_zone_identifier: "XmlStringMaxLen5000",
  termination_policies: ["XmlStringMaxLen1600"],
  new_instances_protected_from_scale_in: false,
  service_linked_role_arn: "ResourceName",
  max_instance_lifetime: 1,
  capacity_rebalance: false,
  context: "Context",
  desired_capacity_type: "XmlStringMaxLen255",
  default_instance_warmup: 1,
  instance_maintenance_policy: {
    min_healthy_percentage: 1,
    max_healthy_percentage: 1,
  },
  availability_zone_distribution: {
    capacity_distribution_strategy: "balanced-only", # accepts balanced-only, balanced-best-effort, reservations-then-balanced
  },
  availability_zone_impairment_policy: {
    zonal_shift_enabled: false,
    impaired_zone_health_check_behavior: "ReplaceUnhealthy", # accepts ReplaceUnhealthy, IgnoreUnhealthy
  },
  skip_zonal_shift_validation: false,
  capacity_reservation_specification: {
    capacity_reservation_preference: "capacity-reservations-only", # accepts capacity-reservations-only, capacity-reservations-first, none, default
    capacity_reservation_target: {
      capacity_reservation_ids: ["AsciiStringMaxLen255"],
      capacity_reservation_resource_group_arns: ["ResourceName"],
    },
  },
  instance_lifecycle_policy: {
    retention_triggers: {
      terminate_hook_abandon: "retain", # accepts retain, terminate
    },
  },
  deletion_protection: "none", # accepts none, prevent-force-deletion, prevent-all-deletion
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :launch_configuration_name (String)

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

  • :launch_template (Types::LaunchTemplateSpecification)

    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.

  • :mixed_instances_policy (Types::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.

  • :min_size (Integer)

    The minimum size of the Auto Scaling group.

  • :max_size (Integer)

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

  • :desired_capacity (Integer)

    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.

  • :default_cooldown (Integer)

    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.

  • :availability_zones (Array<String>)

    One or more Availability Zones for the group.

  • :availability_zone_ids (Array<String>)

    A list of Availability Zone IDs for the Auto Scaling group. You cannot specify both AvailabilityZones and AvailabilityZoneIds in the same request.

  • :health_check_type (String)

    A comma-separated value string of one or more health check types.

    The valid values are EC2, EBS, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be disabled. For more information, see Health checks for instances in an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.

    Only specify EC2 if you must clear a value that was previously set.

  • :health_check_grace_period (Integer)

    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.

  • :placement_group (String)

    The name of an existing placement group into which to launch your instances. To remove the placement group setting, pass an empty string for placement-group. For more information about placement groups, see Placement groups in the Amazon EC2 User Guide.

    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.

  • :vpc_zone_identifier (String)

    A comma-separated list of subnet IDs for a virtual private cloud (VPC). If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you specify must reside in those Availability Zones.

  • :termination_policies (Array<String>)

    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 Configure termination policies for Amazon EC2 Auto Scaling 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

  • :new_instances_protected_from_scale_in (Boolean)

    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 Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.

  • :service_linked_role_arn (String)

    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.

  • :max_instance_lifetime (Integer)

    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.

  • :capacity_rebalance (Boolean)

    Enables or disables Capacity Rebalancing. If Capacity Rebalancing is disabled, proactive replacement of at-risk Spot Instances does not occur. For more information, see Capacity Rebalancing in Auto Scaling to replace at-risk Spot Instances in the Amazon EC2 Auto Scaling User Guide.

    To suspend rebalancing across Availability Zones, use the SuspendProcesses API.

  • :context (String)

    Reserved.

  • :desired_capacity_type (String)

    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 Create a mixed instances 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

  • :default_instance_warmup (Integer)

    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.

  • :instance_maintenance_policy (Types::InstanceMaintenancePolicy)

    An instance maintenance policy. For more information, see Set instance maintenance policy in the Amazon EC2 Auto Scaling User Guide.

  • :availability_zone_distribution (Types::AvailabilityZoneDistribution)

    The instance capacity distribution across Availability Zones.

  • :availability_zone_impairment_policy (Types::AvailabilityZoneImpairmentPolicy)

    The policy for Availability Zone impairment.

  • :skip_zonal_shift_validation (Boolean)

    If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify true. For more information, see Auto Scaling group zonal shift in the Amazon EC2 Auto Scaling User Guide.

  • :capacity_reservation_specification (Types::CapacityReservationSpecification)

    The capacity reservation specification for the Auto Scaling group.

  • :instance_lifecycle_policy (Types::InstanceLifecyclePolicy)

    The instance lifecycle policy for the Auto Scaling group. This policy controls instance behavior when an instance transitions through its lifecycle states. Configure retention triggers to specify when instances should move to a Retained state instead of automatic termination.

    For more information, see Control instance retention with instance lifecycle policies in the Amazon EC2 Auto Scaling User Guide.

  • :deletion_protection (String)

    The deletion protection setting for the Auto Scaling group. This setting helps safeguard your Auto Scaling group and its instances by controlling whether the DeleteAutoScalingGroup operation is allowed. When deletion protection is enabled, users cannot delete the Auto Scaling group according to the specified protection level until the setting is changed back to a less restrictive level.

    The valid values are none, prevent-force-deletion, and prevent-all-deletion.

    Default: none

    For more information, see Configure deletion protection for your Amazon EC2 Auto Scaling resources in the Amazon EC2 Auto Scaling User Guide.

Returns:



391
# File 'sig/auto_scaling_group.rbs', line 391

def update: (

#vpc_zone_identifierString

One or more comma-separated subnet IDs for the Auto Scaling group.

Returns:

  • (String)


76
# File 'sig/auto_scaling_group.rbs', line 76

def vpc_zone_identifier: () -> ::String

#wait_until(options = {}) {|resource| ... } ⇒ Resource

Deprecated.

Use [Aws::AutoScaling::Client] #wait_until instead

Note:

The waiting operation is performed on a copy. The original resource remains unchanged.

Waiter polls an API operation until a resource enters a desired state.

Basic Usage

Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop until condition is true
resource.wait_until(options) {|resource| condition}

Example

instance.wait_until(max_attempts:10, delay:5) do |instance|
  instance.state.name == 'running'
end

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:

# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
  throw :failure if Time.now - started_at > 3600
end

  # disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}

Handling Errors

When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.

begin
  resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

attempts attempt in seconds invoked before each attempt invoked before each wait

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :max_attempts (Integer) — default: 10

    Maximum number of

  • :delay (Integer) — default: 10

    Delay between each

  • :before_attempt (Proc) — default: nil

    Callback

  • :before_wait (Proc) — default: nil

    Callback

Yield Parameters:

  • resource (Resource)

    to be used in the waiting condition.

Returns:

  • (Resource)

    if the waiter was successful

Raises:

  • (Aws::Waiters::Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

    yet successful.

  • (Aws::Waiters::Errors::UnexpectedError)

    Raised when an error is encountered while polling for a resource that is not expected.

  • (NotImplementedError)

    Raised when the resource does not



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/aws-sdk-autoscaling/auto_scaling_group.rb', line 483

def wait_until(options = {}, &block)
  self_copy = self.dup
  attempts = 0
  options[:max_attempts] = 10 unless options.key?(:max_attempts)
  options[:delay] ||= 10
  options[:poller] = Proc.new do
    attempts += 1
    if block.call(self_copy)
      [:success, self_copy]
    else
      self_copy.reload unless attempts == options[:max_attempts]
      :retry
    end
  end
  Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    Aws::Waiters::Waiter.new(options).wait({})
  end
end

#wait_until_exists(options = {}, &block) ⇒ AutoScalingGroup

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :max_attempts (Integer) — default: 10
  • :delay (Float) — default: 5
  • :before_attempt (Proc)
  • :before_wait (Proc)

Returns:



152
153
# File 'sig/auto_scaling_group.rbs', line 152

def wait_until_exists: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) ?{ (untyped waiter) -> void } -> AutoScalingGroup
| (?Hash[Symbol, untyped]) ?{ (untyped waiter) -> void } -> AutoScalingGroup

#wait_until_in_service(options = {}, &block) ⇒ AutoScalingGroup

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :max_attempts (Integer) — default: 40
  • :delay (Float) — default: 15
  • :before_attempt (Proc)
  • :before_wait (Proc)

Returns:



156
157
# File 'sig/auto_scaling_group.rbs', line 156

def wait_until_in_service: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) ?{ (untyped waiter) -> void } -> AutoScalingGroup
| (?Hash[Symbol, untyped]) ?{ (untyped waiter) -> void } -> AutoScalingGroup

#wait_until_not_exists(options = {}, &block) ⇒ AutoScalingGroup

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :max_attempts (Integer) — default: 40
  • :delay (Float) — default: 15
  • :before_attempt (Proc)
  • :before_wait (Proc)

Returns:



160
161
# File 'sig/auto_scaling_group.rbs', line 160

def wait_until_not_exists: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) ?{ (untyped waiter) -> void } -> AutoScalingGroup
| (?Hash[Symbol, untyped]) ?{ (untyped waiter) -> void } -> AutoScalingGroup

#warm_pool_configurationTypes::WarmPoolConfiguration

The warm pool for the group.



100
# File 'sig/auto_scaling_group.rbs', line 100

def warm_pool_configuration: () -> Types::WarmPoolConfiguration

#warm_pool_sizeInteger

The current size of the warm pool.

Returns:

  • (Integer)


103
# File 'sig/auto_scaling_group.rbs', line 103

def warm_pool_size: () -> ::Integer