Class: AWS::AutoScaling::LaunchConfigurationCollection
- Inherits:
-
Object
- Object
- AWS::AutoScaling::LaunchConfigurationCollection
- Includes:
- Core::Collection::Limitable
- Defined in:
- lib/aws/auto_scaling/launch_configuration_collection.rb
Instance Attribute Summary
Attributes included from Core::Model
Instance Method Summary collapse
- #[](name) ⇒ LaunchConfiguration
-
#create(name, image, instance_type, options = {}) ⇒ LaunchConfiguration
Creates an Auto Scaling launch configuration.
Methods included from Core::Collection::Limitable
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Methods included from Core::Model
#client, #config_prefix, #initialize, #inspect
Instance Method Details
#[](name) ⇒ LaunchConfiguration
91 92 93 |
# File 'lib/aws/auto_scaling/launch_configuration_collection.rb', line 91 def [] name LaunchConfiguration.new(name, :config => config) end |
#create(name, image, instance_type, options = {}) ⇒ LaunchConfiguration
Creates an Auto Scaling launch configuration.
auto_scaling.launch_configurations.create('name', 'ami-12345', 'm1.small')
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/aws/auto_scaling/launch_configuration_collection.rb', line 63 def create name, image, instance_type, = {} client_opts = {} client_opts[:launch_configuration_name] = name client_opts[:image_id] = image_id_opt(image) client_opts[:instance_type] = instance_type client_opts[:block_device_mappings] = [:block_device_mappings] if .key?(:block_device_mappings) client_opts[:instance_monitoring] = instance_monitoring_opt() if .key?(:detailed_instance_monitoring) client_opts[:kernel_id] = [:kernel_id] if [:kernel_id] client_opts[:key_name] = key_name_opt() if [:key_pair] client_opts[:ramdisk_id] = [:ramdisk_id] if [:ramdisk_id] client_opts[:security_groups] = security_groups_opt() if .key?(:security_groups) client_opts[:user_data] = user_data_opt() if [:user_data] client.create_launch_configuration(client_opts) LaunchConfiguration.new(name, :image_id => client_opts[:image_id], :instance_type => client_opts[:instance_type], :config => config) end |