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.
-
#iam_instance_profile ⇒ String
readonly
The current value of iam_instance_profile.
-
#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.
-
#spot_price ⇒ String
readonly
The current value of spot_price.
-
#user_data ⇒ String?
readonly
The current value of user_data.
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes the current launch configuration.
-
#exists? ⇒ Boolean
Returns true if this launch configuration exists.
- #image ⇒ EC2::Image
- #key_pair ⇒ KeyPair?
- #security_groups ⇒ Array<EC2::SecurityGroup>
Instance Attribute Details
#arn ⇒ String (readonly)
Returns the current value of arn.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def arn @arn end |
#block_device_mappings ⇒ Array<Hash> (readonly)
Returns the current value of block_device_mappings.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def block_device_mappings @block_device_mappings end |
#created_time ⇒ Time (readonly) Also known as: created_at
Returns the current value of created_time.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 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.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def detailed_instance_monitoring @detailed_instance_monitoring end |
#iam_instance_profile ⇒ String (readonly)
Returns the current value of iam_instance_profile.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def iam_instance_profile @iam_instance_profile end |
#image_id ⇒ String (readonly)
Returns the current value of image_id.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def image_id @image_id end |
#instance_type ⇒ String (readonly)
Returns the current value of instance_type.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def instance_type @instance_type end |
#kernel_id ⇒ String? (readonly)
Returns the current value of kernel_id.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def kernel_id @kernel_id end |
#key_name ⇒ String? (readonly)
Returns the current value of key_name.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def key_name @key_name end |
#name ⇒ String (readonly)
Returns the current value of name.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def name @name end |
#ramdisk_id ⇒ String? (readonly)
Returns the current value of ramdisk_id.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def ramdisk_id @ramdisk_id end |
#spot_price ⇒ String (readonly)
Returns the current value of spot_price.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def spot_price @spot_price end |
#user_data ⇒ String? (readonly)
Returns the current value of user_data.
45 46 47 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45 def user_data @user_data end |
Instance Method Details
#delete ⇒ nil
Deletes the current launch configuration.
139 140 141 142 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 139 def delete client.delete_launch_configuration() nil end |
#exists? ⇒ Boolean
Returns true if this launch configuration exists.
133 134 135 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 133 def exists? !!get_resource.launch_configurations.first end |
#image ⇒ EC2::Image
104 105 106 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 104 def image EC2::Image.new(image_id, :config => config) end |
#key_pair ⇒ KeyPair?
109 110 111 112 113 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 109 def key_pair if key_name EC2::KeyPair.new(key_name, :config => config) end end |
#security_groups ⇒ Array<EC2::SecurityGroup>
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 116 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 |