class AWS::AutoScaling

This class is the starting point for working with Auto Scaling.

To use Auto Scaling you must first [sign up here](aws.amazon.com/autoscaling/).

For more information about Auto Scaling:

# Credentials

You can setup default credentials for all AWS services via AWS#config:

AWS.config(
  :access_key_id => 'YOUR_ACCESS_KEY_ID',
  :secret_access_key => 'YOUR_SECRET_ACCESS_KEY')

Or you can set them directly on the AWS::AutoScaling interface:

auto_scaling = AWS::AutoScaling.new(
  :access_key_id => 'YOUR_ACCESS_KEY_ID',
  :secret_access_key => 'YOUR_SECRET_ACCESS_KEY')

# Launch Configurations

You need to create a launch configuration before you can create an Auto Scaling Group.

# needs a name, image id, and instance type
launch_config = auto_scaling.launch_configurations.create(
  'launch-config-name', 'ami-12345', 'm1.small')

If you have previously created a launch configuration you can reference using the {LaunchConfigurationCollection}.

launch_config = auto_scaling.launch_configurations['launch-config-name']

# Auto Scaling Groups

Given a launch configuration, you can now create an Auto Scaling {Group}.

group = auto_scaling.groups.create('group-name',
  :launch_configuration => launch_config,
  :availability_zones => %w(us-west-2a us-west-2b),
  :min_size => 1,
  :max_size => 4)

@!attribute [r] client

@return [Client] the low-level AutoScaling client object

Public Instance Methods

activities() click to toggle source

@return [ActivityCollection]

# File lib/aws/auto_scaling.rb, line 125
def activities
  ActivityCollection.new(:config => config)
end
adjustment_types() click to toggle source

@return [Array<String>] Returns the list of valid adjustment types.

# File lib/aws/auto_scaling.rb, line 143
def adjustment_types
  client.describe_adjustment_types.adjustment_types.map(&:adjustment_type)
end
groups() click to toggle source

@return [GroupCollection]

# File lib/aws/auto_scaling.rb, line 103
def groups
  GroupCollection.new(:config => config)
end
instances() click to toggle source

@return [AutoScaling::InstancesCollection] Returns a collection of

{AutoScaling::Instance} objects.  Each of these is a small
wrapper around an {EC2::Instance} with additional attributes.
# File lib/aws/auto_scaling.rb, line 120
def instances
  InstanceCollection.new(:config => config)
end
launch_configurations() click to toggle source

@return [LaunchConfigurationCollection]

# File lib/aws/auto_scaling.rb, line 98
def launch_configurations
  LaunchConfigurationCollection.new(:config => config)
end
metric_collection_granularities() click to toggle source

@return [Array<String>] Returns the list of valid metric granularities.

# File lib/aws/auto_scaling.rb, line 158
def metric_collection_granularities
  client.describe_metric_collection_types.granularities.map(&:granularity)
end
metric_collection_types() click to toggle source

@return [Array<String>] Returns the list of valid metric collection types.

# File lib/aws/auto_scaling.rb, line 153
def metric_collection_types
  client.describe_metric_collection_types.metrics.map(&:metric)
end
notification_configurations() click to toggle source

@return [NotificationConfigurationCollection]

# File lib/aws/auto_scaling.rb, line 113
def notification_configurations
  NotificationConfigurationCollection.new(:config => config)
end
notification_types() click to toggle source

Returns a list of all notification types that are supported by Auto Scaling. @return [Array<String>]

# File lib/aws/auto_scaling.rb, line 137
def notification_types
  resp = client.describe_auto_scaling_notification_types
  resp.auto_scaling_notification_types
end
scaling_process_types() click to toggle source

@return [Array<String>] Returns the list of valid scaling process types.

# File lib/aws/auto_scaling.rb, line 148
def scaling_process_types
  client.describe_scaling_process_types.processes.map(&:process_name)
end
scheduled_actions() click to toggle source

@return [ScheduledActionCollection]

# File lib/aws/auto_scaling.rb, line 130
def scheduled_actions
  ScheduledActionCollection.new(:config => config)
end
tags() click to toggle source

@return [TagCollection]

# File lib/aws/auto_scaling.rb, line 108
def tags
  TagCollection.new(:config => config)
end