Class: Aws::EC2::VpcAddress
- Inherits:
-
Object
- Object
- Aws::EC2::VpcAddress
- Extended by:
- Deprecations
- Defined in:
- sig/vpc_address.rbs,
lib/aws-sdk-ec2/vpc_address.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #allocation_id ⇒ String
-
#association_id ⇒ String
The ID representing the association of the address with an instance.
-
#carrier_ip ⇒ String
The carrier IP address associated.
-
#customer_owned_ip ⇒ String
The customer-owned IP address.
-
#customer_owned_ipv_4_pool ⇒ String
The ID of the customer-owned address pool.
-
#domain ⇒ String
The network (
vpc). -
#instance_id ⇒ String
The ID of the instance that the address is associated with (if any).
-
#network_border_group ⇒ String
The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.
-
#network_interface_id ⇒ String
The ID of the network interface.
-
#network_interface_owner_id ⇒ String
The ID of the Amazon Web Services account that owns the network interface.
-
#private_ip_address ⇒ String
The private IP address associated with the Elastic IP address.
-
#public_ip ⇒ String
The Elastic IP address.
-
#public_ipv_4_pool ⇒ String
The ID of an address pool.
-
#service_managed ⇒ String
The service that manages the elastic IP address.
-
#subnet_id ⇒ String
The ID of the subnet where the IP address is allocated.
-
#tags ⇒ Array<Types::Tag>
Any tags assigned to the Elastic IP address.
Actions collapse
Associations collapse
- #association ⇒ NetworkInterfaceAssociation?
- #identifiers ⇒ Object deprecated private Deprecated.
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Address
Returns the data for this VpcAddress.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ VpcAddress
constructor
A new instance of VpcAddress.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current VpcAddress.
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::EC2::Client] #wait_until instead
Constructor Details
#initialize(allocation_id, options = {}) ⇒ VpcAddress #initialize(options = {}) ⇒ VpcAddress
Returns a new instance of VpcAddress.
13 14 15 |
# File 'sig/vpc_address.rbs', line 13
def initialize: (String allocation_id, Hash[Symbol, untyped] options) -> void
| (allocation_id: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#allocation_id ⇒ String
18 |
# File 'sig/vpc_address.rbs', line 18
def allocation_id: () -> String
|
#associate(options = {}) ⇒ Types::AssociateAddressResult
79 |
# File 'sig/vpc_address.rbs', line 79
def associate: (
|
#association ⇒ NetworkInterfaceAssociation?
98 |
# File 'sig/vpc_address.rbs', line 98
def association: () -> NetworkInterfaceAssociation?
|
#association_id ⇒ String
The ID representing the association of the address with an instance.
21 |
# File 'sig/vpc_address.rbs', line 21
def association_id: () -> ::String
|
#carrier_ip ⇒ String
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).
51 |
# File 'sig/vpc_address.rbs', line 51
def carrier_ip: () -> ::String
|
#customer_owned_ip ⇒ String
The customer-owned IP address.
45 |
# File 'sig/vpc_address.rbs', line 45
def customer_owned_ip: () -> ::String
|
#customer_owned_ipv_4_pool ⇒ String
The ID of the customer-owned address pool.
48 |
# File 'sig/vpc_address.rbs', line 48
def customer_owned_ipv_4_pool: () -> ::String
|
#data ⇒ Types::Address
Returns the data for this Aws::EC2::VpcAddress. Calls
Client#describe_addresses if #data_loaded? is false.
72 |
# File 'sig/vpc_address.rbs', line 72
def data: () -> Types::Address
|
#data_loaded? ⇒ Boolean
75 |
# File 'sig/vpc_address.rbs', line 75
def data_loaded?: () -> bool
|
#domain ⇒ String
The network (vpc).
24 |
# File 'sig/vpc_address.rbs', line 24
def domain: () -> ("vpc" | "standard")
|
#identifiers ⇒ Object
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.
365 366 367 |
# File 'lib/aws-sdk-ec2/vpc_address.rb', line 365 def identifiers { allocation_id: @allocation_id } end |
#instance_id ⇒ String
The ID of the instance that the address is associated with (if any).
60 |
# File 'sig/vpc_address.rbs', line 60
def instance_id: () -> ::String
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::VpcAddress.
Returns self making it possible to chain methods.
vpc_address.reload.data
68 |
# File 'sig/vpc_address.rbs', line 68
def load: () -> self
|
#network_border_group ⇒ String
The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.
42 |
# File 'sig/vpc_address.rbs', line 42
def network_border_group: () -> ::String
|
#network_interface_id ⇒ String
The ID of the network interface.
27 |
# File 'sig/vpc_address.rbs', line 27
def network_interface_id: () -> ::String
|
#network_interface_owner_id ⇒ String
The ID of the Amazon Web Services account that owns the network interface.
30 |
# File 'sig/vpc_address.rbs', line 30
def network_interface_owner_id: () -> ::String
|
#private_ip_address ⇒ String
The private IP address associated with the Elastic IP address.
33 |
# File 'sig/vpc_address.rbs', line 33
def private_ip_address: () -> ::String
|
#public_ip ⇒ String
The Elastic IP address.
63 |
# File 'sig/vpc_address.rbs', line 63
def public_ip: () -> ::String
|
#public_ipv_4_pool ⇒ String
The ID of an address pool.
39 |
# File 'sig/vpc_address.rbs', line 39
def public_ipv_4_pool: () -> ::String
|
#release(options = {}) ⇒ EmptyStructure
90 |
# File 'sig/vpc_address.rbs', line 90
def release: (
|
#service_managed ⇒ String
The service that manages the elastic IP address.
alb.
57 |
# File 'sig/vpc_address.rbs', line 57
def service_managed: () -> ("alb" | "nlb" | "rnat" | "rds")
|
#subnet_id ⇒ String
The ID of the subnet where the IP address is allocated.
54 |
# File 'sig/vpc_address.rbs', line 54
def subnet_id: () -> ::String
|
#tags ⇒ Array<Types::Tag>
Any tags assigned to the Elastic IP address.
36 |
# File 'sig/vpc_address.rbs', line 36
def tags: () -> ::Array[Types::Tag]
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::EC2::Client] #wait_until instead
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() {|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
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/aws-sdk-ec2/vpc_address.rb', line 253 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |