Class: AWS::AutoScaling::LaunchConfiguration
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::AutoScaling::LaunchConfiguration
- Defined in:
- lib/aws/auto_scaling/launch_configuration.rb
Instance Attribute Summary collapse
-
#arn ⇒ String
readonly
The current value of arn.
-
#block_device_mappings ⇒ Array<Hash>
readonly
The current value of block_device_mappings.
-
#created_time ⇒ Time
(also: #created_at)
readonly
The current value of created_time.
-
#detailed_instance_monitoring ⇒ Boolean
(also: #detailed_instance_monitoring?)
readonly
The current value of detailed_instance_monitoring.
-
#image_id ⇒ String
readonly
The current value of image_id.
-
#instance_type ⇒ String
readonly
The current value of instance_type.
-
#kernel_id ⇒ String?
readonly
The current value of kernel_id.
-
#key_name ⇒ String?
readonly
The current value of key_name.
-
#name ⇒ String
readonly
The current value of name.
-
#ramdisk_id ⇒ String?
readonly
The current value of ramdisk_id.
-
#user_data ⇒ String?
readonly
The current value of user_data.
Attributes included from Core::Model
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes the current launch configuration.
-
#exists? ⇒ Boolean
Returns true if this launch configuration exists.
- #image ⇒ EC2::Image
-
#initialize(name, options = {}) ⇒ LaunchConfiguration
constructor
A new instance of LaunchConfiguration.
- #key_pair ⇒ KeyPair?
- #security_groups ⇒ Array<EC2::SecurityGroup>
Methods inherited from Core::Resource
attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from
Methods included from Core::Cacheable
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(name, options = {}) ⇒ LaunchConfiguration
Returns a new instance of LaunchConfiguration.
44 45 46 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 44 def initialize name, = {} super(.merge(:name => name)) end |
Instance Attribute Details
#arn ⇒ String (readonly)
Returns the current value of arn.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def arn @arn end |
#block_device_mappings ⇒ Array<Hash> (readonly)
Returns the current value of block_device_mappings.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def block_device_mappings @block_device_mappings end |
#created_time ⇒ Time (readonly) Also known as: created_at
Returns the current value of created_time.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def created_time @created_time end |
#detailed_instance_monitoring ⇒ Boolean (readonly) Also known as: detailed_instance_monitoring?
Returns the current value of detailed_instance_monitoring.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def detailed_instance_monitoring @detailed_instance_monitoring end |
#image_id ⇒ String (readonly)
Returns the current value of image_id.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def image_id @image_id end |
#instance_type ⇒ String (readonly)
Returns the current value of instance_type.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def instance_type @instance_type end |
#kernel_id ⇒ String? (readonly)
Returns the current value of kernel_id.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def kernel_id @kernel_id end |
#key_name ⇒ String? (readonly)
Returns the current value of key_name.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def key_name @key_name end |
#name ⇒ String (readonly)
Returns the current value of name.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def name @name end |
#ramdisk_id ⇒ String? (readonly)
Returns the current value of ramdisk_id.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def ramdisk_id @ramdisk_id end |
#user_data ⇒ String? (readonly)
Returns the current value of user_data.
41 42 43 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 41 def user_data @user_data end |
Instance Method Details
#delete ⇒ nil
Deletes the current launch configuration.
131 132 133 134 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 131 def delete client.delete_launch_configuration() nil end |
#exists? ⇒ Boolean
Returns true if this launch configuration exists.
125 126 127 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 125 def exists? !!get_resource.launch_configurations.first end |
#image ⇒ EC2::Image
96 97 98 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 96 def image EC2::Image.new(image_id, :config => config) end |
#key_pair ⇒ KeyPair?
101 102 103 104 105 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 101 def key_pair if key_name EC2::KeyPair.new(key_name, :config => config) end end |
#security_groups ⇒ Array<EC2::SecurityGroup>
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 108 def security_groups names_or_ids = security_group_details if names_or_ids.all?{|str| str.match(/^sg-[0-9a-f]{8}$/) } names_or_ids.collect do |security_group_id| EC2::SecurityGroup.new(security_group_id, :config => config) end else begin ec2 = EC2.new(:config => config) ec2.security_groups.filter('group-name', *names_or_ids).to_a rescue names_or_ids end end end |