You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::AutoScaling::AutoScalingGroup

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

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

Overloads:

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

    Parameters:

    • name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

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

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#auto_scaling_group_arnString (readonly)

The Amazon Resource Name (ARN) of the group.

Returns:

  • (String)

    The Amazon Resource Name (ARN) of the group.

#auto_scaling_group_nameString (readonly)

The name of the group.

Returns:

  • (String)

    The name of the group.

#availability_zonesArray<String> (readonly)

One or more Availability Zones for the group.

Returns:

  • (Array<String>)

    One or more Availability Zones for the group.

#created_timeTime (readonly)

The date and time the group was created.

Returns:

  • (Time)

    The date and time the group was created.

#default_cooldownInteger (readonly)

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

Returns:

  • (Integer)

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

#desired_capacityInteger (readonly)

The desired size of the group.

Returns:

  • (Integer)

    The desired size of the group.

#enabled_metricsArray<Types::EnabledMetric> (readonly)

The metrics enabled for the group.

Returns:

#health_check_grace_periodInteger (readonly)

The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service.

Returns:

  • (Integer)

    The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service.

#health_check_typeString (readonly)

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

Returns:

  • (String)

    The service to use for the health checks.

#launch_configuration_nameString (readonly)

The name of the associated launch configuration.

Returns:

  • (String)

    The name of the associated launch configuration.

#load_balancer_namesArray<String> (readonly)

One or more load balancers associated with the group.

Returns:

  • (Array<String>)

    One or more load balancers associated with the group.

#max_sizeInteger (readonly)

The maximum size of the group.

Returns:

  • (Integer)

    The maximum size of the group.

#min_sizeInteger (readonly)

The minimum size of the group.

Returns:

  • (Integer)

    The minimum size of the group.

#nameString (readonly)

Returns:

  • (String)

#new_instances_protected_from_scale_inBoolean (readonly)

Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

Returns:

  • (Boolean)

    Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

#placement_groupString (readonly)

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

Returns:

  • (String)

    The name of the placement group into which you\'ll launch your instances, if any.

#statusString (readonly)

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

Returns:

#suspended_processesArray<Types::SuspendedProcess> (readonly)

The suspended processes associated with the group.

Returns:

#target_group_arnsArray<String> (readonly)

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

Returns:

  • (Array<String>)

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

#termination_policiesArray<String> (readonly)

The termination policies for the group.

Returns:

  • (Array<String>)

    The termination policies for the group.

#vpc_zone_identifierString (readonly)

One or more subnet IDs, if applicable, separated by commas.

If you specify VPCZoneIdentifier and AvailabilityZones, ensure that the Availability Zones of the subnets match the values for AvailabilityZones.

Returns:

  • (String)

    One or more subnet IDs, if applicable, separated by commas.

Instance Method Details

#activities(options = {}) ⇒ Collection<Activity>

Returns a Collection of Aws::AutoScaling::Activity resources. No API requests are made until you call an enumerable method on the collection. Client#describe_scaling_activities will be called multiple times until every Aws::AutoScaling::Activity has been yielded.

Examples:

Request syntax example with placeholder values


autoscalinggroup.activities({
  activity_ids: ["XmlString"],
  max_records: 1,
  next_token: "XmlString",
})

Enumerating Aws::AutoScaling::Activity resources.

autoscalinggroup.activities.each do |activity|
  # yields each activity
end

Enumerating Aws::AutoScaling::Activity resources with a limit.

autoscalinggroup.activities.limit(10).each do |activity|
  # yields at most 10 activities
end

Options Hash (options):

  • :activity_ids (Array<String>)

    The activity IDs of the desired scaling activities. If you omit this parameter, all activities for the past six weeks are described. If you specify an Auto Scaling group, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error.

  • :max_records (Integer)

    The maximum number of items to return with this call. The default value is 100.

  • :next_token (String)

    The token for the next set of items to return. (You received this token from a previous call.)

Returns:

See Also:

#attach_instances(options = {}) ⇒ Struct

Attaches one or more EC2 instances to the specified Auto Scaling group.

When you attach instances, Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails.

If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups.

For more information, see Attach EC2 Instances to Your Auto Scaling Group in the Auto Scaling User Guide.

Examples:

Request syntax example with placeholder values


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

Options Hash (options):

  • :instance_ids (Array<String>)

    One or more instance IDs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete(options = {}) ⇒ Struct

Deletes the specified Auto Scaling group.

If the group has instances or scaling activities in progress, you must specify the option to force the deletion in order for it to succeed.

If the group has policies, deleting the group deletes the policies, the underlying alarm actions, and any alarm that no longer has an associated action.

To remove instances from the Auto Scaling group before deleting it, call DetachInstances with the list of instances and the option to decrement the desired capacity so that Auto Scaling does not launch replacement instances.

To terminate all instances before deleting the Auto Scaling group, call UpdateAutoScalingGroup and set the minimum size and desired capacity of the Auto Scaling group to zero.

Examples:

Request syntax example with placeholder values


autoscalinggroup.delete({
  force_delete: false,
})

Options Hash (options):

  • :force_delete (Boolean)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#detach_instances(options = {}) ⇒ Array<Activity>

Examples:

Request syntax example with placeholder values


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

Basic usage

activitys = autoscalinggroup.detach_instances(options)
activitys.map(&:id)
#=> ["activity-id", ...]

Options Hash (options):

  • :instance_ids (Array<String>)

    One or more instance IDs.

  • :should_decrement_desired_capacity (required, Boolean)

    If True, the Auto Scaling group decrements the desired capacity value by the number of instances detached.

Returns:

See Also:

#disable_metrics_collection(options = {}) ⇒ Struct

Disables group metrics for the specified Auto Scaling group.

Examples:

Request syntax example with placeholder values


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

Options Hash (options):

  • :metrics (Array<String>)

    One or more of the following metrics. If you omit this parameter, all metrics are disabled.

    • GroupMinSize

    • GroupMaxSize

    • GroupDesiredCapacity

    • GroupInServiceInstances

    • GroupPendingInstances

    • GroupStandbyInstances

    • GroupTerminatingInstances

    • GroupTotalInstances

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#enable_metrics_collection(options = {}) ⇒ Struct

Enables group metrics for the specified Auto Scaling group. For more information, see Monitoring Your Auto Scaling Groups and Instances in the Auto Scaling User Guide.

Examples:

Request syntax example with placeholder values


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

Options Hash (options):

  • :metrics (Array<String>)

    One or more of the following metrics. If you omit this parameter, all metrics are enabled.

    • GroupMinSize

    • GroupMaxSize

    • GroupDesiredCapacity

    • GroupInServiceInstances

    • GroupPendingInstances

    • GroupStandbyInstances

    • GroupTerminatingInstances

    • GroupTotalInstances

  • :granularity (required, String)

    The granularity to associate with the metrics to collect. The only valid value is 1Minute.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#exists?Boolean

Returns true if this AutoScalingGroup exists. Returns false otherwise.

Returns:

  • (Boolean)

    Returns true if this AutoScalingGroup exists. Returns false otherwise.

#instancesArray<Instance>?

Returns:

#launch_configurationLaunchConfiguration?

Returns:

#lifecycle_hook(name) ⇒ LifecycleHook

Parameters:

Returns:

See Also:

#lifecycle_hooks(options = {}) ⇒ Collection<LifecycleHook>

Returns a Collection of LifecycleHook resources. No API requests are made until you call an enumerable method on the collection. Client#describe_lifecycle_hooks will be called multiple times until every LifecycleHook has been yielded.

Examples:

Request syntax example with placeholder values


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

Enumerating LifecycleHook resources.

autoscalinggroup.lifecycle_hooks.each do |lifecyclehook|
  # yields each lifecyclehook
end

Enumerating LifecycleHook resources with a limit.

autoscalinggroup.lifecycle_hooks.limit(10).each do |lifecyclehook|
  # yields at most 10 lifecycle_hooks
end

Options Hash (options):

  • :lifecycle_hook_names (Array<String>)

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

Returns:

See Also:

#load_balancer(name) ⇒ LoadBalancer

Parameters:

Returns:

See Also:

#load_balancers(options = {}) ⇒ Collection<LoadBalancer>

Returns a Collection of LoadBalancer resources. No API requests are made until you call an enumerable method on the collection. Client#describe_load_balancers will be called multiple times until every LoadBalancer has been yielded.

Examples:

Request syntax example with placeholder values


autoscalinggroup.load_balancers({
  next_token: "XmlString",
  max_records: 1,
})

Enumerating LoadBalancer resources.

autoscalinggroup.load_balancers.each do |loadbalancer|
  # yields each loadbalancer
end

Enumerating LoadBalancer resources with a limit.

autoscalinggroup.load_balancers.limit(10).each do |loadbalancer|
  # yields at most 10 load_balancers
end

Batch operations callable on the returned collection


# calls Client#attach_load_balancers on each batch
autoscalinggroup.load_balancers.batch_attach

# calls Client#detach_load_balancers on each batch
autoscalinggroup.load_balancers.batch_detach

Options Hash (options):

  • :next_token (String)

    The token for the next set of items to return. (You received this token from a previous call.)

  • :max_records (Integer)

    The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Returns:

See Also:

#notification_configurations(options = {}) ⇒ Collection<NotificationConfiguration>

Returns a Collection of NotificationConfiguration resources. No API requests are made until you call an enumerable method on the collection. Client#describe_notification_configurations will be called multiple times until every NotificationConfiguration has been yielded.

Examples:

Request syntax example with placeholder values


autoscalinggroup.notification_configurations({
  next_token: "XmlString",
  max_records: 1,
})

Enumerating NotificationConfiguration resources.

autoscalinggroup.notification_configurations.each do |notificationconfiguration|
  # yields each notificationconfiguration
end

Enumerating NotificationConfiguration resources with a limit.

autoscalinggroup.notification_configurations.limit(10).each do |notificationconfiguration|
  # yields at most 10 notification_configurations
end

Batch operations callable on the returned collection


# calls Client#put_notification_configuration on each batch
autoscalinggroup.notification_configurations.batch_put

Options Hash (options):

  • :next_token (String)

    The token for the next set of items to return. (You received this token from a previous call.)

  • :max_records (Integer)

    The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Returns:

See Also:

#policies(options = {}) ⇒ Collection<ScalingPolicy>

Returns a Collection of ScalingPolicy resources. No API requests are made until you call an enumerable method on the collection. Client#describe_policies will be called multiple times until every ScalingPolicy has been yielded.

Examples:

Request syntax example with placeholder values


autoscalinggroup.policies({
  policy_names: ["ResourceName"],
  policy_types: ["XmlStringMaxLen64"],
  next_token: "XmlString",
  max_records: 1,
})

Enumerating ScalingPolicy resources.

autoscalinggroup.policies.each do |scalingpolicy|
  # yields each scalingpolicy
end

Enumerating ScalingPolicy resources with a limit.

autoscalinggroup.policies.limit(10).each do |scalingpolicy|
  # yields at most 10 policies
end

Options Hash (options):

  • :policy_names (Array<String>)

    One or more policy names or policy ARNs to be described. If you omit this parameter, all policy names are described. If an group name is provided, the results are limited to that group. This list is limited to 50 items. If you specify an unknown policy name, it is ignored with no error.

  • :policy_types (Array<String>)

    One or more policy types. Valid values are SimpleScaling and StepScaling.

  • :next_token (String)

    The token for the next set of items to return. (You received this token from a previous call.)

  • :max_records (Integer)

    The maximum number of items to be returned with each call. The default value is 50 and the maximum value is 100.

Returns:

See Also:

#put_scaling_policy(options = {}) ⇒ ScalingPolicy

Examples:

Request syntax example with placeholder values


autoscalinggroup.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", # required
      namespace: "MetricNamespace", # required
      dimensions: [
        {
          name: "MetricDimensionName", # required
          value: "MetricDimensionValue", # required
        },
      ],
      statistic: "Average", # required, accepts Average, Minimum, Maximum, SampleCount, Sum
      unit: "MetricUnit",
    },
    target_value: 1.0, # required
    disable_scale_in: false,
  },
})

Basic usage

scalingpolicy = autoscalinggroup.put_scaling_policy(options)
scalingpolicy.name
#=> "scalingpolicy-name"

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy.

  • :policy_type (String)

    The policy type. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling. If the policy type is null, the value is treated as SimpleScaling.

  • :adjustment_type (String)

    The adjustment type. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

    This parameter is supported if the policy type is SimpleScaling or StepScaling.

    For more information, see Dynamic Scaling in the Auto Scaling User Guide.

  • :min_adjustment_step (Integer)

    Available for backward compatibility. Use MinAdjustmentMagnitude instead.

  • :min_adjustment_magnitude (Integer)

    The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

    This parameter is supported if the policy type is SimpleScaling or StepScaling.

  • :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.

    This parameter is required if the policy type is SimpleScaling and not supported otherwise.

  • :cooldown (Integer)

    The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start. If this parameter is not specified, the default cooldown period for the group applies.

    This parameter is supported if the policy type is SimpleScaling.

    For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide.

  • :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.

    This parameter is supported 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.

    This parameter is required if the policy type is StepScaling and not supported otherwise.

  • :estimated_instance_warmup (Integer)

    The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. The default is to use the value specified for the default cooldown period for the group.

    This parameter is supported if the policy type is StepScaling or TargetTrackingScaling.

  • :target_tracking_configuration (Types::TargetTrackingConfiguration)

    A target tracking policy.

    This parameter is required if the policy type is TargetTrackingScaling and not supported otherwise.

Returns:

See Also:

#put_scheduled_update_group_action(options = {}) ⇒ ScheduledAction

Examples:

Request syntax example with placeholder values


autoscalinggroup.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,
})

Basic usage

scheduledaction = autoscalinggroup.put_scheduled_update_group_action(options)
scheduledaction.name
#=> "scheduledaction-name"

Options Hash (options):

  • :scheduled_action_name (required, String)

    The name of this scaling action.

  • :time (Time)

    This parameter is deprecated.

  • :start_time (Time)

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

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

    If you try to schedule your action in the past, Auto Scaling returns an error message.

  • :end_time (Time)

    The time for the recurring schedule to end. Auto Scaling does not perform the action after this time.

  • :recurrence (String)

    The recurring schedule for this action, in Unix cron syntax format. For more information, see Cron in Wikipedia.

  • :min_size (Integer)

    The minimum size for the Auto Scaling group.

  • :max_size (Integer)

    The maximum size for the Auto Scaling group.

  • :desired_capacity (Integer)

    The number of EC2 instances that should be running in the group.

Returns:

See Also:

#resume_processes(options = {}) ⇒ Struct

Resumes the specified suspended Auto Scaling processes, or all suspended process, for the specified Auto Scaling group.

For more information, see Suspending and Resuming Auto Scaling Processes in the Auto Scaling User Guide.

Examples:

Request syntax example with placeholder values


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

Options Hash (options):

  • :scaling_processes (Array<String>)

    One or more of the following processes. If you omit this parameter, all processes are specified.

    • Launch

    • Terminate

    • HealthCheck

    • ReplaceUnhealthy

    • AZRebalance

    • AlarmNotification

    • ScheduledActions

    • AddToLoadBalancer

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#scheduled_actions(options = {}) ⇒ Collection<ScheduledAction>

Returns a Collection of ScheduledAction resources. No API requests are made until you call an enumerable method on the collection. Client#describe_scheduled_actions will be called multiple times until every ScheduledAction has been yielded.

Examples:

Request syntax example with placeholder values


autoscalinggroup.scheduled_actions({
  scheduled_action_names: ["ResourceName"],
  start_time: Time.now,
  end_time: Time.now,
  next_token: "XmlString",
  max_records: 1,
})

Enumerating ScheduledAction resources.

autoscalinggroup.scheduled_actions.each do |scheduledaction|
  # yields each scheduledaction
end

Enumerating ScheduledAction resources with a limit.

autoscalinggroup.scheduled_actions.limit(10).each do |scheduledaction|
  # yields at most 10 scheduled_actions
end

Options Hash (options):

  • :scheduled_action_names (Array<String>)

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

    You can describe up to a maximum of 50 instances with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token.

  • :start_time (Time)

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

  • :end_time (Time)

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

  • :next_token (String)

    The token for the next set of items to return. (You received this token from a previous call.)

  • :max_records (Integer)

    The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Returns:

See Also:

#set_desired_capacity(options = {}) ⇒ Struct

Sets the size of the specified Auto Scaling group.

For more information about desired capacity, see What Is Auto Scaling? in the Auto Scaling User Guide.

Examples:

Request syntax example with placeholder values


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

Options Hash (options):

  • :desired_capacity (required, Integer)

    The number of EC2 instances that should be running in the Auto Scaling group.

  • :honor_cooldown (Boolean)

    By default, SetDesiredCapacity overrides any cooldown period associated with the Auto Scaling group. Specify True to make Auto Scaling to wait for the cool-down period associated with the Auto Scaling group to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#suspend_processes(options = {}) ⇒ Struct

Suspends the specified Auto Scaling processes, or all processes, for the specified Auto Scaling group.

Note that if you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly.

To resume processes that have been suspended, use ResumeProcesses.

For more information, see Suspending and Resuming Auto Scaling Processes in the Auto Scaling User Guide.

Examples:

Request syntax example with placeholder values


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

Options Hash (options):

  • :scaling_processes (Array<String>)

    One or more of the following processes. If you omit this parameter, all processes are specified.

    • Launch

    • Terminate

    • HealthCheck

    • ReplaceUnhealthy

    • AZRebalance

    • AlarmNotification

    • ScheduledActions

    • AddToLoadBalancer

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#tag(key) ⇒ Tag

Parameters:

  • key (String)

    The Tag#key identifier.

Returns:

See Also:

#tagsArray<Tag>?

Returns:

  • (Array<Tag>, nil)

See Also:

#update(options = {}) ⇒ AutoScalingGroup

Examples:

Request syntax example with placeholder values


autoscalinggroup.update({
  launch_configuration_name: "ResourceName",
  min_size: 1,
  max_size: 1,
  desired_capacity: 1,
  default_cooldown: 1,
  availability_zones: ["XmlStringMaxLen255"],
  health_check_type: "XmlStringMaxLen32",
  health_check_grace_period: 1,
  placement_group: "XmlStringMaxLen255",
  vpc_zone_identifier: "XmlStringMaxLen2047",
  termination_policies: ["XmlStringMaxLen1600"],
  new_instances_protected_from_scale_in: false,
})

Basic usage

autoscalinggroup = autoscalinggroup.update(options)
autoscalinggroup.name
#=> "autoscalinggroup-name"

Options Hash (options):

  • :launch_configuration_name (String)

    The name of the launch configuration.

  • :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 number of EC2 instances that should be running in the Auto Scaling group. 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)

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

    For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide.

  • :availability_zones (Array<String>)

    One or more Availability Zones for the group.

  • :health_check_type (String)

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

  • :health_check_grace_period (Integer)

    The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service. The default is 0.

    For more information, see Health Checks in the Auto Scaling User Guide.

  • :placement_group (String)

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

  • :vpc_zone_identifier (String)

    The ID of the subnet, if you are launching into a VPC. You can specify several subnets in a comma-separated list.

    When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the subnets\' Availability Zones match the values you specify for AvailabilityZones.

    For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.

  • :termination_policies (Array<String>)

    A standalone termination policy or a list of termination policies used to select the instance to terminate. The policies are executed in the order that they are listed.

    For more information, see Controlling Which Instances Auto Scaling Terminates During Scale In in the Auto Scaling User Guide.

  • :new_instances_protected_from_scale_in (Boolean)

    Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

Returns:

See Also:

#wait_until_exists {|waiter| ... } ⇒ AutoScalingGroup

Waits until this AutoScalingGroup is exists. This method waits by polling Client#describe_auto_scaling_groups until successful. An error is raised after a configurable number of failed checks.

This waiter uses the following defaults:

Configuration Default
#delay 5
#max_attempts 10

You can modify defaults and register callbacks by passing a block argument.

Examples:

Basic usage

autoscalinggroup.wait_until_exists

Yield Parameters:

Returns:

  • (AutoScalingGroup)

    Returns a copy of this AutoScalingGroup that is not loaded.

Raises:

See Also:

#wait_until_in_service {|waiter| ... } ⇒ AutoScalingGroup

Waits until this AutoScalingGroup is in_service. This method waits by polling Client#describe_auto_scaling_groups until successful. An error is raised after a configurable number of failed checks.

This waiter uses the following defaults:

Configuration Default
#delay 15
#max_attempts 40

You can modify defaults and register callbacks by passing a block argument.

Examples:

Basic usage

autoscalinggroup.wait_until_in_service

Yield Parameters:

Returns:

  • (AutoScalingGroup)

    Returns a copy of this AutoScalingGroup that is not loaded.

Raises:

See Also:

#wait_until_not_exists {|waiter| ... } ⇒ AutoScalingGroup

Waits until this AutoScalingGroup is not_exists. This method waits by polling Client#describe_auto_scaling_groups until successful. An error is raised after a configurable number of failed checks.

This waiter uses the following defaults:

Configuration Default
#delay 15
#max_attempts 40

You can modify defaults and register callbacks by passing a block argument.

Examples:

Basic usage

autoscalinggroup.wait_until_not_exists

Yield Parameters:

Returns:

  • (AutoScalingGroup)

    Returns a copy of this AutoScalingGroup that is not loaded.

Raises:

See Also: