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
- Object
- Resources::Resource
- Aws::AutoScaling::AutoScalingGroup
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#auto_scaling_group_arn ⇒ String
readonly
The Amazon Resource Name (ARN) of the Auto Scaling group.
-
#auto_scaling_group_name ⇒ String
readonly
The name of the Auto Scaling group.
-
#availability_zones ⇒ Array<String>
readonly
One or more Availability Zones for the group.
-
#capacity_rebalance ⇒ Boolean
readonly
Indicates whether Capacity Rebalancing is enabled.
-
#created_time ⇒ Time
readonly
The date and time the group was created.
-
#default_cooldown ⇒ Integer
readonly
The duration of the default cooldown period, in seconds.
-
#desired_capacity ⇒ Integer
readonly
The desired size of the group.
-
#enabled_metrics ⇒ Array<Types::EnabledMetric>
readonly
The metrics enabled for the group.
-
#health_check_grace_period ⇒ Integer
readonly
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.
-
#health_check_type ⇒ String
readonly
The service to use for the health checks.
-
#launch_configuration_name ⇒ String
readonly
The name of the associated launch configuration.
-
#launch_template ⇒ Types::LaunchTemplateSpecification
readonly
The launch template for the group.
-
#load_balancer_names ⇒ Array<String>
readonly
One or more load balancers associated with the group.
-
#max_instance_lifetime ⇒ Integer
readonly
The maximum amount of time, in seconds, that an instance can be in service.
-
#max_size ⇒ Integer
readonly
The maximum size of the group.
-
#min_size ⇒ Integer
readonly
The minimum size of the group.
-
#mixed_instances_policy ⇒ Types::MixedInstancesPolicy
readonly
The mixed instances policy for the group.
-
#name ⇒ String
readonly
-
#new_instances_protected_from_scale_in ⇒ Boolean
readonly
Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
-
#placement_group ⇒ String
readonly
The name of the placement group into which to launch your instances, if any.
-
#service_linked_role_arn ⇒ String
readonly
The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf.
-
#status ⇒ String
readonly
The current state of the group when the DeleteAutoScalingGroup operation is in progress.
-
#suspended_processes ⇒ Array<Types::SuspendedProcess>
readonly
The suspended processes associated with the group.
-
#target_group_arns ⇒ Array<String>
readonly
The Amazon Resource Names (ARN) of the target groups for your load balancer.
-
#termination_policies ⇒ Array<String>
readonly
The termination policies for the group.
-
#vpc_zone_identifier ⇒ String
readonly
One or more subnet IDs, if applicable, separated by commas.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#activities(options = {}) ⇒ Collection<Activity>
Returns a Collection of Activity resources.
-
#attach_instances(options = {}) ⇒ Struct
Attaches one or more EC2 instances to the specified Auto Scaling group.
When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the number of instances being attached.
-
#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 the DetachInstances API with the list of instances and the option to decrement the desired capacity.
-
#detach_instances(options = {}) ⇒ Array<Activity>
-
#disable_metrics_collection(options = {}) ⇒ Struct
Disables group metrics for the specified Auto Scaling group.
.
-
#enable_metrics_collection(options = {}) ⇒ Struct
Enables group metrics for the specified Auto Scaling group.
-
#exists? ⇒ Boolean
Returns
true
if this AutoScalingGroup exists. -
#initialize ⇒ Object
constructor
-
#instances ⇒ Array<Instance>?
-
#launch_configuration ⇒ LaunchConfiguration?
-
#lifecycle_hook(name) ⇒ LifecycleHook
-
#lifecycle_hooks(options = {}) ⇒ Collection<LifecycleHook>
Returns a Collection of LifecycleHook resources.
-
#load_balancer(name) ⇒ LoadBalancer
-
#load_balancers(options = {}) ⇒ Collection<LoadBalancer>
Returns a Collection of LoadBalancer resources.
-
#notification_configurations(options = {}) ⇒ Collection<NotificationConfiguration>
Returns a Collection of NotificationConfiguration resources.
-
#policies(options = {}) ⇒ Collection<ScalingPolicy>
Returns a Collection of ScalingPolicy resources.
-
#put_scaling_policy(options = {}) ⇒ ScalingPolicy
-
#put_scheduled_update_group_action(options = {}) ⇒ ScheduledAction
-
#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 scaling processes in the Amazon EC2 Auto Scaling User Guide.
. -
#scheduled_actions(options = {}) ⇒ Collection<ScheduledAction>
Returns a Collection of ScheduledAction resources.
-
#set_desired_capacity(options = {}) ⇒ Struct
Sets the size of the specified Auto Scaling group.
If a scale-in activity occurs as a result of a new
DesiredCapacity
value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. -
#suspend_processes(options = {}) ⇒ Struct
Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.
If you suspend either the
Launch
orTerminate
process types, it can prevent other process types from functioning properly. -
#tag(key) ⇒ Tag
-
#tags ⇒ Array<Tag>?
-
#update(options = {}) ⇒ AutoScalingGroup
-
#wait_until_exists {|waiter| ... } ⇒ AutoScalingGroup
Waits until this AutoScalingGroup is exists.
-
#wait_until_in_service {|waiter| ... } ⇒ AutoScalingGroup
Waits until this AutoScalingGroup is in_service.
-
#wait_until_not_exists {|waiter| ... } ⇒ AutoScalingGroup
Waits until this AutoScalingGroup is not_exists.
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
Instance Attribute Details
#auto_scaling_group_arn ⇒ String (readonly)
The Amazon Resource Name (ARN) of the Auto Scaling group.
#auto_scaling_group_name ⇒ String (readonly)
The name of the Auto Scaling group.
#availability_zones ⇒ Array<String> (readonly)
One or more Availability Zones for the group.
#capacity_rebalance ⇒ Boolean (readonly)
Indicates whether Capacity Rebalancing is enabled.
#created_time ⇒ Time (readonly)
The date and time the group was created.
#default_cooldown ⇒ Integer (readonly)
The duration of the default cooldown period, in seconds.
#desired_capacity ⇒ Integer (readonly)
The desired size of the group.
#enabled_metrics ⇒ Array<Types::EnabledMetric> (readonly)
The metrics enabled for the group.
#health_check_grace_period ⇒ Integer (readonly)
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.
#health_check_type ⇒ String (readonly)
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.
#launch_configuration_name ⇒ String (readonly)
The name of the associated launch configuration.
#launch_template ⇒ Types::LaunchTemplateSpecification (readonly)
The launch template for the group.
#load_balancer_names ⇒ Array<String> (readonly)
One or more load balancers associated with the group.
#max_instance_lifetime ⇒ Integer (readonly)
The maximum amount of time, in seconds, that an instance can be in service.
Valid Range: Minimum value of 0.
#max_size ⇒ Integer (readonly)
The maximum size of the group.
#min_size ⇒ Integer (readonly)
The minimum size of the group.
#mixed_instances_policy ⇒ Types::MixedInstancesPolicy (readonly)
The mixed instances policy for the group.
#name ⇒ String (readonly)
#new_instances_protected_from_scale_in ⇒ Boolean (readonly)
Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
#placement_group ⇒ String (readonly)
The name of the placement group into which to launch your instances, if any.
#service_linked_role_arn ⇒ String (readonly)
The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf.
#status ⇒ String (readonly)
The current state of the group when the DeleteAutoScalingGroup operation is in progress.
#suspended_processes ⇒ Array<Types::SuspendedProcess> (readonly)
The suspended processes associated with the group.
#target_group_arns ⇒ Array<String> (readonly)
The Amazon Resource Names (ARN) of the target groups for your load balancer.
#termination_policies ⇒ Array<String> (readonly)
The termination policies for the group.
#vpc_zone_identifier ⇒ String (readonly)
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.
#attach_instances(options = {}) ⇒ Struct
Attaches one or more EC2 instances to the specified Auto Scaling group.
When you attach instances, Amazon EC2 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 Amazon EC2 Auto Scaling User Guide.
#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 the DetachInstances API with the list of instances and the option to decrement the desired capacity. This ensures that Amazon EC2 Auto Scaling does not launch replacement instances.
To terminate all instances before deleting the Auto Scaling group, call the UpdateAutoScalingGroup API and set the minimum size and desired capacity of the Auto Scaling group to zero.
#detach_instances(options = {}) ⇒ Array<Activity>
#disable_metrics_collection(options = {}) ⇒ Struct
Disables group metrics for the specified Auto Scaling group.
#enable_metrics_collection(options = {}) ⇒ Struct
Enables group metrics for the specified Auto Scaling group. For more information, see Monitoring CloudWatch metrics for your Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
#exists? ⇒ Boolean
Returns true
if this AutoScalingGroup exists. Returns false
otherwise.
#instances ⇒ Array<Instance>?
#launch_configuration ⇒ LaunchConfiguration?
#lifecycle_hook(name) ⇒ LifecycleHook
#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.
#load_balancer(name) ⇒ LoadBalancer
#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.
#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.
#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.
#put_scaling_policy(options = {}) ⇒ ScalingPolicy
#put_scheduled_update_group_action(options = {}) ⇒ ScheduledAction
#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 scaling processes in the Amazon EC2 Auto Scaling User Guide.
#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.
#set_desired_capacity(options = {}) ⇒ Struct
Sets the size of the specified Auto Scaling group.
If a scale-in activity occurs as a result of a new DesiredCapacity
value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate.
For more information, see Manual scaling in the Amazon EC2 Auto Scaling User Guide.
#suspend_processes(options = {}) ⇒ Struct
Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.
If you suspend either the Launch
or Terminate
process types, it can prevent other process types from functioning properly. For more information, see Suspending and resuming scaling processes in the Amazon EC2 Auto Scaling User Guide.
To resume processes that have been suspended, call the ResumeProcesses API.
#tag(key) ⇒ Tag
#tags ⇒ Array<Tag>?
#update(options = {}) ⇒ AutoScalingGroup
#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.
#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.
#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.