Class: Aws::AutoScaling::LaunchConfiguration

Inherits:
Object
  • Object
show all
Extended by:
Deprecations
Defined in:
sig/launch_configuration.rbs,
lib/aws-sdk-autoscaling/launch_configuration.rb

Overview

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Actions collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of LaunchConfiguration.

Overloads:



13
14
15
# File 'sig/launch_configuration.rbs', line 13

def initialize: (String name, Hash[Symbol, untyped] options) -> void
| (name: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void

Instance Method Details

#associate_public_ip_addressBoolean

Specifies whether to assign a public IPv4 address to the group's instances. If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet. For more information, see Provide network connectivity for your Auto Scaling instances using Amazon VPC in the Amazon EC2 Auto Scaling User Guide.

Returns:

  • (Boolean)


70
# File 'sig/launch_configuration.rbs', line 70

def associate_public_ip_address: () -> bool

#block_device_mappingsArray<Types::BlockDeviceMapping>

The block device mapping entries that define the block devices to attach to the instances at launch. By default, the block devices specified in the block device mapping for the AMI are used. For more information, see Block device mappings in the Amazon EC2 User Guide.

Returns:



52
# File 'sig/launch_configuration.rbs', line 52

def block_device_mappings: () -> ::Array[Types::BlockDeviceMapping]

Available for backward compatibility.

Returns:

  • (String)


34
# File 'sig/launch_configuration.rbs', line 34

def classic_link_vpc_id: () -> ::String

Available for backward compatibility.

Returns:

  • (Array<String>)


37
# File 'sig/launch_configuration.rbs', line 37

def classic_link_vpc_security_groups: () -> ::Array[::String]

#clientClient

Returns:



248
# File 'lib/aws-sdk-autoscaling/launch_configuration.rb', line 248

def client: () -> Client

#created_timeTime

The creation date and time for the launch configuration.

Returns:

  • (Time)


64
# File 'sig/launch_configuration.rbs', line 64

def created_time: () -> ::Time

#dataTypes::LaunchConfiguration



85
# File 'sig/launch_configuration.rbs', line 85

def data: () -> Types::LaunchConfiguration

#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.



88
# File 'sig/launch_configuration.rbs', line 88

def data_loaded?: () -> bool

#delete(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


launch_configuration.delete()

Parameters:

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

    ({})

Returns:

  • (EmptyStructure)


92
# File 'sig/launch_configuration.rbs', line 92

def delete: (

#ebs_optimizedBoolean

Specifies whether the launch configuration is optimized for EBS I/O (true) or not (false). For more information, see Amazon EBS-optimized instances in the Amazon EC2 User Guide.

Returns:

  • (Boolean)


67
# File 'sig/launch_configuration.rbs', line 67

def ebs_optimized: () -> bool

#iam_instance_profileString

The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. For more information, see IAM role for applications that run on Amazon EC2 instances in the Amazon EC2 Auto Scaling User Guide.

Returns:

  • (String)


61
# File 'sig/launch_configuration.rbs', line 61

def iam_instance_profile: () -> ::String

#identifiersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.


398
399
400
# File 'lib/aws-sdk-autoscaling/launch_configuration.rb', line 398

def identifiers
  { name: @name }
end

#image_idString

The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. For more information, see Find a Linux AMI in the Amazon EC2 User Guide.

Returns:

  • (String)


25
# File 'sig/launch_configuration.rbs', line 25

def image_id: () -> ::String

#instance_monitoringTypes::InstanceMonitoring

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

For more information, see Configure monitoring for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide.



55
# File 'sig/launch_configuration.rbs', line 55

def instance_monitoring: () -> Types::InstanceMonitoring

#instance_typeString

The instance type for the instances. For information about available instance types, see Available instance types in the Amazon EC2 User Guide.

Returns:

  • (String)


43
# File 'sig/launch_configuration.rbs', line 43

def instance_type: () -> ::String

#kernel_idString

The ID of the kernel associated with the AMI.

Returns:

  • (String)


46
# File 'sig/launch_configuration.rbs', line 46

def kernel_id: () -> ::String

#key_nameString

The name of the key pair.

For more information, see Amazon EC2 key pairs and Amazon EC2 instances in the Amazon EC2 User Guide.

Returns:

  • (String)


28
# File 'sig/launch_configuration.rbs', line 28

def key_name: () -> ::String

#launch_configuration_arnString

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

Returns:

  • (String)


22
# File 'sig/launch_configuration.rbs', line 22

def launch_configuration_arn: () -> ::String

#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)


81
# File 'sig/launch_configuration.rbs', line 81

def load: () -> self

#metadata_optionsTypes::InstanceMetadataOptions

The metadata options for the instances. For more information, see Configure the instance metadata options in the Amazon EC2 Auto Scaling User Guide.



76
# File 'sig/launch_configuration.rbs', line 76

def metadata_options: () -> Types::InstanceMetadataOptions

#nameString Also known as: launch_configuration_name

Returns:

  • (String)


18
# File 'sig/launch_configuration.rbs', line 18

def name: () -> String

#placement_tenancyString

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

Returns:

  • (String)


73
# File 'sig/launch_configuration.rbs', line 73

def placement_tenancy: () -> ::String

#ramdisk_idString

The ID of the RAM disk associated with the AMI.

Returns:

  • (String)


49
# File 'sig/launch_configuration.rbs', line 49

def ramdisk_id: () -> ::String

#security_groupsArray<String>

A list that contains the security groups to assign to the instances in the Auto Scaling group. For more information, see Control traffic to your Amazon Web Services resources using security groups in the Amazon Virtual Private Cloud User Guide.

Returns:

  • (Array<String>)


31
# File 'sig/launch_configuration.rbs', line 31

def security_groups: () -> ::Array[::String]

#spot_priceString

The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot price. For more information, see Requesting Spot Instances for fault-tolerant and flexible applications in the Amazon EC2 Auto Scaling User Guide.

Returns:

  • (String)


58
# File 'sig/launch_configuration.rbs', line 58

def spot_price: () -> ::String

#user_dataString

The user data to make available to the launched EC2 instances. For more information, see Instance metadata and user data in the Amazon EC2 User Guide. If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.

Returns:

  • (String)


40
# File 'sig/launch_configuration.rbs', line 40

def user_data: () -> ::String

#wait_until(options = {}) {|resource| ... } ⇒ Resource

Deprecated.

Use [Aws::AutoScaling::Client] #wait_until instead

Note:

The waiting operation is performed on a copy. The original resource remains unchanged.

Waiter polls an API operation until a resource enters a desired state.

Basic Usage

Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop until condition is true
resource.wait_until(options) {|resource| condition}

Example

instance.wait_until(max_attempts:10, delay:5) do |instance|
  instance.state.name == 'running'
end

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:

# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
  throw :failure if Time.now - started_at > 3600
end

  # disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}

Handling Errors

When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.

begin
  resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

attempts attempt in seconds invoked before each attempt invoked before each wait

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :max_attempts (Integer) — default: 10

    Maximum number of

  • :delay (Integer) — default: 10

    Delay between each

  • :before_attempt (Proc) — default: nil

    Callback

  • :before_wait (Proc) — default: nil

    Callback

Yield Parameters:

  • resource (Resource)

    to be used in the waiting condition.

Returns:

  • (Resource)

    if the waiter was successful

Raises:

  • (Aws::Waiters::Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

    yet successful.

  • (Aws::Waiters::Errors::UnexpectedError)

    Raised when an error is encountered while polling for a resource that is not expected.

  • (NotImplementedError)

    Raised when the resource does not



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/aws-sdk-autoscaling/launch_configuration.rb', line 362

def wait_until(options = {}, &block)
  self_copy = self.dup
  attempts = 0
  options[:max_attempts] = 10 unless options.key?(:max_attempts)
  options[:delay] ||= 10
  options[:poller] = Proc.new do
    attempts += 1
    if block.call(self_copy)
      [:success, self_copy]
    else
      self_copy.reload unless attempts == options[:max_attempts]
      :retry
    end
  end
  Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    Aws::Waiters::Waiter.new(options).wait({})
  end
end