Class: Serverspec::Type::AWS::AutoScaling::Group
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::AWS::AutoScaling::Group
- Defined in:
- lib/resources/autoscaling/group.rb
Overview
The Group class exposes the AutoScaling::Group resources
Instance Method Summary collapse
-
#availability_zones ⇒ Array(String)
One or more availability zones for the Group.
-
#default_cooldown ⇒ Integer
The number of seconds after a scaling activity completes before any further scaling activities can start.
-
#desired_capacity ⇒ Integer
The size of the Group.
-
#enabled_metrics ⇒ Array(Hash)
The metrics enabled for this Group.
-
#health_check_grace_period ⇒ Integer
The amount of time that AutoScaling waits before checking an instance's health status after being in service.
-
#health_check_type ⇒ String
The service of interest for the health status check, which can be either EC2 or ELB.
-
#initialize(group_name, instance = nil) ⇒ Group
constructor
AWS SDK for Ruby v2 Aws::AutoScaling::Client wrapper for initializing a Group resource.
-
#instance_count ⇒ Integer
The number of EC2 Instances associated with the Group.
-
#instances ⇒ Array(Hash)
The EC2 Instances associated with the Group.
-
#launch_configuration ⇒ String
The name of the associated LaunchConfiguration.
-
#load_balancer_names ⇒ Array(String)
One or more LoadBalancers associated with the Group.
-
#max_size ⇒ Integer
The maximum size of the Group.
-
#min_size ⇒ Integer
The minimum size of the Group.
-
#placement_group ⇒ String
The name of the placement group into which you'll launch your Instances.
-
#scaling_policies ⇒ Array(Hash)
The policies for the Group.
-
#status ⇒ String
The current state of the Group when a DeleteAutoScalingGroup action is in progress.
-
#suspended_processes ⇒ Array(Hash)
The suspended processes associated with the Group.
-
#tags ⇒ Array(Hash)
The tags for the Group.
-
#termination_policies ⇒ Array(String)
The termination policies for this Group.
-
#to_s ⇒ Object
Returns the String representation of AutoScaling::Group.
-
#vpc_subnets ⇒ Array(String)
One or more Subnet IDs, if applicable.
Constructor Details
#initialize(group_name, instance = nil) ⇒ Group
AWS SDK for Ruby v2 Aws::AutoScaling::Client wrapper for initializing a Group resource
15 16 17 18 19 20 |
# File 'lib/resources/autoscaling/group.rb', line 15 def initialize(group_name, instance = nil) check_init_arg 'group_name', 'AutoScaling::Group', group_name @group_name = group_name @aws = instance.nil? ? Aws::AutoScaling::Client.new : instance get_group group_name end |
Instance Method Details
#availability_zones ⇒ Array(String)
One or more availability zones for the Group
60 61 62 |
# File 'lib/resources/autoscaling/group.rb', line 60 def availability_zones @group.availability_zones end |
#default_cooldown ⇒ Integer
The number of seconds after a scaling activity completes before any further scaling activities can start
54 55 56 |
# File 'lib/resources/autoscaling/group.rb', line 54 def default_cooldown @group.default_cooldown end |
#desired_capacity ⇒ Integer
The size of the Group
47 48 49 |
# File 'lib/resources/autoscaling/group.rb', line 47 def desired_capacity @group.desired_capacity end |
#enabled_metrics ⇒ Array(Hash)
The metrics enabled for this Group
134 135 136 |
# File 'lib/resources/autoscaling/group.rb', line 134 def enabled_metrics @group.enabled_metrics end |
#health_check_grace_period ⇒ Integer
The amount of time that AutoScaling waits before checking an instance's health status after being in service
80 81 82 |
# File 'lib/resources/autoscaling/group.rb', line 80 def health_check_grace_period @group.health_check_grace_period end |
#health_check_type ⇒ String
The service of interest for the health status check, which can be either EC2 or ELB
73 74 75 |
# File 'lib/resources/autoscaling/group.rb', line 73 def health_check_type @group.health_check_type end |
#instance_count ⇒ Integer
The number of EC2 Instances associated with the Group
102 103 104 |
# File 'lib/resources/autoscaling/group.rb', line 102 def instance_count @group.instances.length end |
#instances ⇒ Array(Hash)
The EC2 Instances associated with the Group
96 97 98 |
# File 'lib/resources/autoscaling/group.rb', line 96 def instances @group.instances end |
#launch_configuration ⇒ String
The name of the associated LaunchConfiguration
29 30 31 |
# File 'lib/resources/autoscaling/group.rb', line 29 def launch_configuration @group.launch_configuration_name end |
#load_balancer_names ⇒ Array(String)
One or more LoadBalancers associated with the Group
66 67 68 |
# File 'lib/resources/autoscaling/group.rb', line 66 def load_balancer_names @group.load_balancer_names end |
#max_size ⇒ Integer
The maximum size of the Group
41 42 43 |
# File 'lib/resources/autoscaling/group.rb', line 41 def max_size @group.max_size end |
#min_size ⇒ Integer
The minimum size of the Group
35 36 37 |
# File 'lib/resources/autoscaling/group.rb', line 35 def min_size @group.min_size end |
#placement_group ⇒ String
The name of the placement group into which you'll launch your Instances
122 123 124 |
# File 'lib/resources/autoscaling/group.rb', line 122 def placement_group @group.placement_group end |
#scaling_policies ⇒ Array(Hash)
The policies for the Group
159 160 161 162 163 |
# File 'lib/resources/autoscaling/group.rb', line 159 def scaling_policies @aws.describe_policies( auto_scaling_group_name: @group_name ).scaling_policies end |
#status ⇒ String
The current state of the Group when a DeleteAutoScalingGroup action is in progress
141 142 143 |
# File 'lib/resources/autoscaling/group.rb', line 141 def status @group.status end |
#suspended_processes ⇒ Array(Hash)
The suspended processes associated with the Group
115 116 117 |
# File 'lib/resources/autoscaling/group.rb', line 115 def suspended_processes @group.suspended_processes end |
#tags ⇒ Array(Hash)
The tags for the Group
147 148 149 |
# File 'lib/resources/autoscaling/group.rb', line 147 def @group. end |
#termination_policies ⇒ Array(String)
The termination policies for this Group
153 154 155 |
# File 'lib/resources/autoscaling/group.rb', line 153 def termination_policies @group.termination_policies end |
#to_s ⇒ Object
Returns the String representation of AutoScaling::Group
23 24 25 |
# File 'lib/resources/autoscaling/group.rb', line 23 def to_s "AutoScaling Group: #{@group_name}" end |
#vpc_subnets ⇒ Array(String)
One or more Subnet IDs, if applicable
128 129 130 |
# File 'lib/resources/autoscaling/group.rb', line 128 def vpc_subnets @group.vpc_zone_identifier.split(',').map(&:strip) end |