Class: Aws::EC2::ClassicAddress

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

Overview

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Actions collapse

Instance Method Summary collapse

Constructor Details

#initialize(public_ip, options = {}) ⇒ ClassicAddress #initialize(options = {}) ⇒ ClassicAddress

Returns a new instance of ClassicAddress.

Overloads:

  • #initialize(public_ip, options = {}) ⇒ ClassicAddress

    Parameters:

    • public_ip (String)

    Options Hash (options):

  • #initialize(options = {}) ⇒ ClassicAddress

    Options Hash (options):

    • :public_ip (required, String)
    • :client (Client)


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

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

Instance Method Details

#allocation_idString

The ID representing the allocation of the address.

Returns:

  • (String)


21
# File 'sig/classic_address.rbs', line 21

def allocation_id: () -> ::String

#associate(options = {}) ⇒ Types::AssociateAddressResult

Examples:

Request syntax with placeholder values


classic_address.associate({
  allocation_id: "AllocationId",
  instance_id: "InstanceId",
  dry_run: false,
  network_interface_id: "NetworkInterfaceId",
  private_ip_address: "String",
  allow_reassociation: false,
})

Parameters:

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

    ({})

Options Hash (options):

  • :allocation_id (String)

    The allocation ID. This is required.

  • :instance_id (String)

    The ID of the instance. The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :network_interface_id (String)

    The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

    You can specify either the instance ID or the network interface ID, but not both.

  • :private_ip_address (String)

    The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

  • :allow_reassociation (Boolean)

    Reassociation is automatic, but you can specify false to ensure the operation fails if the Elastic IP address is already associated with another resource.

Returns:



79
# File 'sig/classic_address.rbs', line 79

def associate: (

#association_idString

The ID representing the association of the address with an instance.

Returns:

  • (String)


24
# File 'sig/classic_address.rbs', line 24

def association_id: () -> ::String

#carrier_ipString

The carrier IP address associated. This option is only available for network interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 instance).

Returns:

  • (String)


54
# File 'sig/classic_address.rbs', line 54

def carrier_ip: () -> ::String

#clientClient

Returns:



139
# File 'lib/aws-sdk-ec2/classic_address.rb', line 139

def client: () -> Client

#customer_owned_ipString

The customer-owned IP address.

Returns:

  • (String)


48
# File 'sig/classic_address.rbs', line 48

def customer_owned_ip: () -> ::String

#customer_owned_ipv_4_poolString

The ID of the customer-owned address pool.

Returns:

  • (String)


51
# File 'sig/classic_address.rbs', line 51

def customer_owned_ipv_4_pool: () -> ::String

#dataTypes::Address

Returns the data for this Aws::EC2::ClassicAddress. Calls Aws::EC2::Client#describe_addresses if #data_loaded? is false.

Returns:



72
# File 'sig/classic_address.rbs', line 72

def data: () -> Types::Address

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



75
# File 'sig/classic_address.rbs', line 75

def data_loaded?: () -> bool

#disassociate(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


classic_address.disassociate({
  association_id: "ElasticIpAssociationId",
  dry_run: false,
})

Parameters:

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

    ({})

Options Hash (options):

  • :association_id (String)

    The association ID. This parameter is required.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (EmptyStructure)


90
# File 'sig/classic_address.rbs', line 90

def disassociate: (

#domainString

The network (vpc).

Returns:

  • (String)


27
# File 'sig/classic_address.rbs', line 27

def domain: () -> ("vpc" | "standard")

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


374
375
376
# File 'lib/aws-sdk-ec2/classic_address.rb', line 374

def identifiers
  { public_ip: @public_ip }
end

#instance_idString

The ID of the instance that the address is associated with (if any).

Returns:

  • (String)


63
# File 'sig/classic_address.rbs', line 63

def instance_id: () -> ::String

#loadself Also known as: reload

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

classic_address.reload.data

Returns:

  • (self)


68
# File 'sig/classic_address.rbs', line 68

def load: () -> self

#network_border_groupString

The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.

Returns:

  • (String)


45
# File 'sig/classic_address.rbs', line 45

def network_border_group: () -> ::String

#network_interface_idString

The ID of the network interface.

Returns:

  • (String)


30
# File 'sig/classic_address.rbs', line 30

def network_interface_id: () -> ::String

#network_interface_owner_idString

The ID of the Amazon Web Services account that owns the network interface.

Returns:

  • (String)


33
# File 'sig/classic_address.rbs', line 33

def network_interface_owner_id: () -> ::String

#private_ip_addressString

The private IP address associated with the Elastic IP address.

Returns:

  • (String)


36
# File 'sig/classic_address.rbs', line 36

def private_ip_address: () -> ::String

#public_ipString

Returns:

  • (String)


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

def public_ip: () -> String

#public_ipv_4_poolString

The ID of an address pool.

Returns:

  • (String)


42
# File 'sig/classic_address.rbs', line 42

def public_ipv_4_pool: () -> ::String

#release(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


classic_address.release({
  allocation_id: "AllocationId",
  network_border_group: "String",
  dry_run: false,
})

Parameters:

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

    ({})

Options Hash (options):

  • :allocation_id (String)

    The allocation ID. This parameter is required.

  • :network_border_group (String)

    The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.

    If you provide an incorrect network border group, you receive an InvalidAddress.NotFound error.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (EmptyStructure)


97
# File 'sig/classic_address.rbs', line 97

def release: (

#service_managedString

The service that manages the elastic IP address.

The only option supported today is alb.

Returns:

  • (String)


60
# File 'sig/classic_address.rbs', line 60

def service_managed: () -> ("alb" | "nlb" | "rnat" | "rds")

#subnet_idString

The ID of the subnet where the IP address is allocated.

Returns:

  • (String)


57
# File 'sig/classic_address.rbs', line 57

def subnet_id: () -> ::String

#tagsArray<Types::Tag>

Any tags assigned to the Elastic IP address.

Returns:



39
# File 'sig/classic_address.rbs', line 39

def tags: () -> ::Array[Types::Tag]

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

Deprecated.

Use [Aws::EC2::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



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/aws-sdk-ec2/classic_address.rb', line 253

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