lib/ec2/right_ec2_instances.rb
# Launch new EC2 instances. Returns a list of launched instances or an exception.
#
#  ec2.run_instances('ami-e444444d',1,1,['2009-07-15-default'],'my_awesome_key', 'Woohoo!!!', 'public') #=>
#   [{:aws_image_id       => "ami-e444444d",
#     :aws_reason         => "",
#     :aws_state_code     => "0",
#     :aws_owner          => "000000000888",
#     :aws_instance_id    => "i-123f1234",
#     :aws_reservation_id => "r-aabbccdd",
#     :aws_state          => "pending",
#     :dns_name           => "",
#     :ssh_key_name       => "my_awesome_key",
#     :groups             => [{:group_name=>"2009-07-15-default", :group_id=>"sg-90c5d6fc"}],
#     :private_dns_name   => "",
#     :aws_instance_type  => "m1.small",
#     :aws_launch_time    => "2008-1-1T00:00:00.000Z"
#     :aws_ramdisk_id     => "ari-8605e0ef"
#     :aws_kernel_id      => "aki-9905e0f0",
#     :ami_launch_index   => "0",
#     :aws_availability_zone => "us-east-1b"
#     }]
#
Launch new EC2 instances. Returns a list of launched instances or an exception.
Launch new EC2 instances . Returns a list of launched instances or an exception .
def run_instances(image_id, min_count, max_count, group_names, key_name, user_data='',
                      addressing_type = nil, instance_type = nil,
                      kernel_id = nil, ramdisk_id = nil, availability_zone = nil,
                      monitoring_enabled = nil, subnet_id = nil, disable_api_termination = nil,
                      instance_initiated_shutdown_behavior = nil, block_device_mappings = nil,
                      placement_group_name = nil, client_token = nil)
 	    launch_instances(image_id, { :min_count                            => min_count,
 	                                 :max_count                            => max_count,
 	                                 :user_data                            => user_data,
                                   :group_names                          => group_names,
                                   :key_name                             => key_name,
                                   :instance_type                        => instance_type,
                                   :kernel_id                            => kernel_id,
                                   :ramdisk_id                           => ramdisk_id,
                                   :availability_zone                    => availability_zone,
                                   :monitoring_enabled                   => monitoring_enabled,
                                   :subnet_id                            => subnet_id,
                                   :disable_api_termination              => disable_api_termination,
                                   :instance_initiated_shutdown_behavior => instance_initiated_shutdown_behavior,
                                   :block_device_mappings                => block_device_mappings,
                                   :placement_group_name                 => placement_group_name,
                                   :client_token                         => client_token
                                 })
    end
def run_instances ( image_id , min_count , max_count , group_names , key_name , user_data = '' , addressing_type = nil , instance_type = nil , kernel_id = nil , ramdisk_id = nil , availability_zone = nil , monitoring_enabled = nil , subnet_id = nil , disable_api_termination = nil , instance_initiated_shutdown_behavior = nil , block_device_mappings = nil , placement_group_name = nil , client_token = nil ) launch_instances ( image_id , { :min_count => min_count , :max_count => max_count , :user_data => user_data , :group_names => group_names , :key_name => key_name , :instance_type => instance_type , :kernel_id => kernel_id , :ramdisk_id => ramdisk_id , :availability_zone => availability_zone , :monitoring_enabled => monitoring_enabled , :subnet_id => subnet_id , :disable_api_termination => disable_api_termination , :instance_initiated_shutdown_behavior => instance_initiated_shutdown_behavior , :block_device_mappings => block_device_mappings , :placement_group_name => placement_group_name , :client_token => client_token } ) end
Launch new EC2 instances.
Launch new EC2 instances .
image_id
<not_specific>
min_count
<not_specific>
max_count
<not_specific>
group_names
<not_specific>
key_name
<not_specific>
user_data
<not_specific>
addressing_type
<not_specific>
instance_type
<not_specific>
kernel_id
<not_specific>
ramdisk_id
<not_specific>
availability_zone
<not_specific>
monitoring_enabled
<not_specific>
subnet_id
<not_specific>
disable_api_termination
<not_specific>
instance_initiated_shutdown_behavior
<not_specific>
block_device_mappings
<not_specific>
placement_group_name
<not_specific>
client_token
<not_specific>