Class: AWS::AutoScaling::LaunchConfiguration

Inherits:
Core::Resource
  • Object
show all
Defined in:
lib/aws/auto_scaling/launch_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#arnString (readonly)

Returns the current value of arn.

Returns:

  • (String)

    the current value of arn



45
46
47
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45

def arn
  @arn
end

#block_device_mappingsArray<Hash> (readonly)

Returns the current value of block_device_mappings.

Returns:

  • (Array<Hash>)

    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_timeTime (readonly) Also known as: created_at

Returns the current value of created_time.

Returns:

  • (Time)

    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_monitoringBoolean (readonly) Also known as: detailed_instance_monitoring?

Returns the current value of detailed_instance_monitoring.

Returns:

  • (Boolean)

    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_profileString (readonly)

Returns the current value of iam_instance_profile.

Returns:

  • (String)

    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_idString (readonly)

Returns the current value of image_id.

Returns:

  • (String)

    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_typeString (readonly)

Returns the current value of instance_type.

Returns:

  • (String)

    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_idString? (readonly)

Returns the current value of kernel_id.

Returns:

  • (String, nil)

    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_nameString? (readonly)

Returns the current value of key_name.

Returns:

  • (String, nil)

    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

#nameString (readonly)

Returns the current value of name.

Returns:

  • (String)

    the current value of name



45
46
47
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 45

def name
  @name
end

#ramdisk_idString? (readonly)

Returns the current value of ramdisk_id.

Returns:

  • (String, nil)

    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_priceString (readonly)

Returns the current value of spot_price.

Returns:

  • (String)

    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_dataString? (readonly)

Returns the current value of user_data.

Returns:

  • (String, nil)

    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

#deletenil

Deletes the current launch configuration.

Returns:

  • (nil)


139
140
141
142
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 139

def delete
  client.delete_launch_configuration(resource_options)
  nil
end

#exists?Boolean

Returns true if this launch configuration exists.

Returns:

  • (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

#imageEC2::Image

Returns:



104
105
106
# File 'lib/aws/auto_scaling/launch_configuration.rb', line 104

def image
  EC2::Image.new(image_id, :config => config)
end

#key_pairKeyPair?

Returns:

  • (KeyPair, nil)


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_groupsArray<EC2::SecurityGroup>

Returns:



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