Class: AWS::AutoScaling::LaunchConfigurationCollection
- Inherits:
-
Object
- Object
- AWS::AutoScaling::LaunchConfigurationCollection
- Includes:
- Core::Collection::WithLimitAndNextToken
- Defined in:
- lib/aws/auto_scaling/launch_configuration_collection.rb
Instance Method Summary collapse
- #[](name) ⇒ LaunchConfiguration
-
#create(name, image, instance_type, options = {}) ⇒ LaunchConfiguration
Creates an Auto Scaling launch configuration.
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Instance Method Details
#[](name) ⇒ LaunchConfiguration
101 102 103 |
# File 'lib/aws/auto_scaling/launch_configuration_collection.rb', line 101 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')
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/aws/auto_scaling/launch_configuration_collection.rb', line 67 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[:instance_monitoring] = instance_monitoring_opt() if .key?(:detailed_instance_monitoring) client_opts[:key_name] = key_name_opt() if [:key_pair] client_opts[:security_groups] = security_groups_opt() if .key?(:security_groups) client_opts[:user_data] = user_data_opt() if [:user_data] [ :iam_instance_profile, :spot_price, :kernel_id, :ramdisk_id, :block_device_mappings, ].each do |opt| client_opts[opt] = [opt] if .key?(opt) end client.create_launch_configuration(client_opts) LaunchConfiguration.new(name, :image_id => client_opts[:image_id], :instance_type => client_opts[:instance_type], :config => config) end |