You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScaling::LaunchConfiguration

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb

Defined Under Namespace

Classes: Collection

Actions collapse

Read-Only Attributes collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ LaunchConfiguration #initialize(options = {}) ⇒ LaunchConfiguration

Returns a new instance of LaunchConfiguration

Overloads:



19
20
21
22
23
24
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 19

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @name = extract_name(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

Instance Method Details

#associate_public_ip_addressBoolean

[EC2-VPC] Indicates whether to assign a public IP address to each instance.

Returns:

  • (Boolean)


152
153
154
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 152

def associate_public_ip_address
  data.associate_public_ip_address
end

#block_device_mappingsArray<Types::BlockDeviceMapping>

A block device mapping, which specifies the block devices for the instance.

Returns:



112
113
114
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 112

def block_device_mappings
  data.block_device_mappings
end

The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter can only be used if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

Returns:

  • (String)


67
68
69
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 67

def classic_link_vpc_id
  data.classic_link_vpc_id
end

The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. This parameter is required if you specify a ClassicLink-enabled VPC, and cannot be used otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

Returns:

  • (Array<String>)


81
82
83
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 81

def classic_link_vpc_security_groups
  data.classic_link_vpc_security_groups
end

#clientClient

Returns:



167
168
169
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 167

def client
  @client
end

#created_timeTime

The creation date and time for the launch configuration.

Returns:

  • (Time)


138
139
140
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 138

def created_time
  data.created_time
end

#dataTypes::LaunchConfiguration



187
188
189
190
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 187

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



195
196
197
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 195

def data_loaded?
  !!@data
end

#delete(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


launch_configuration.delete()

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Returns:

  • (EmptyStructure)


206
207
208
209
210
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 206

def delete(options = {})
  options = options.merge(launch_configuration_name: @name)
  resp = @client.delete_launch_configuration(options)
  resp.data
end

#ebs_optimizedBoolean

Controls whether the instance is optimized for EBS I/O (true) or not (false).

Returns:

  • (Boolean)


145
146
147
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 145

def ebs_optimized
  data.ebs_optimized
end

#iam_instance_profileString

The name or Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

Returns:

  • (String)


132
133
134
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 132

def iam_instance_profile
  data.iam_instance_profile
end

#image_idString

The ID of the Amazon Machine Image (AMI).

Returns:

  • (String)


42
43
44
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 42

def image_id
  data.image_id
end

#instance_monitoringTypes::InstanceMonitoring

Controls whether instances in this group are launched with detailed (true) or basic (false) monitoring.



119
120
121
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 119

def instance_monitoring
  data.instance_monitoring
end

#instance_typeString

The instance type for the instances.

Returns:

  • (String)


93
94
95
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 93

def instance_type
  data.instance_type
end

#kernel_idString

The ID of the kernel associated with the AMI.

Returns:

  • (String)


99
100
101
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 99

def kernel_id
  data.kernel_id
end

#key_nameString

The name of the key pair.

Returns:

  • (String)


48
49
50
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 48

def key_name
  data.key_name
end

#launch_configuration_arnString

The Amazon Resource Name (ARN) of the launch configuration.

Returns:

  • (String)


36
37
38
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 36

def launch_configuration_arn
  data.launch_configuration_arn
end

#loadself Also known as: reload

Loads, or reloads #data for the current Aws::AutoScaling::LaunchConfiguration. Returns self making it possible to chain methods.

launch_configuration.reload.data

Returns:

  • (self)


177
178
179
180
181
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 177

def load
  resp = @client.describe_launch_configurations(launch_configuration_names: [@name])
  @data = resp.launch_configurations[0]
  self
end

#nameString Also known as: launch_configuration_name

Returns:

  • (String)


29
30
31
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 29

def name
  @name
end

#placement_tenancyString

The tenancy of the instance, either default or dedicated. An instance with dedicated tenancy runs in an isolated, single-tenant hardware and can only be launched into a VPC.

Returns:

  • (String)


160
161
162
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 160

def placement_tenancy
  data.placement_tenancy
end

#ramdisk_idString

The ID of the RAM disk associated with the AMI.

Returns:

  • (String)


105
106
107
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 105

def ramdisk_id
  data.ramdisk_id
end

#security_groupsArray<String>

The security groups to associate with the instances.

Returns:

  • (Array<String>)


54
55
56
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 54

def security_groups
  data.security_groups
end

#spot_priceString

The price to bid when launching Spot Instances.

Returns:

  • (String)


125
126
127
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 125

def spot_price
  data.spot_price
end

#user_dataString

The user data available to the instances.

Returns:

  • (String)


87
88
89
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb', line 87

def user_data
  data.user_data
end