Class: Aws::EC2::NetworkInterface
- Inherits:
-
Object
- Object
- Aws::EC2::NetworkInterface
- Extended by:
- Deprecations
- Defined in:
- sig/network_interface.rbs,
lib/aws-sdk-ec2/network_interface.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#associated_subnets ⇒ Array<String>
The subnets associated with this network interface.
-
#attachment ⇒ Types::NetworkInterfaceAttachment
The network interface attachment.
-
#availability_zone ⇒ String
The Availability Zone.
-
#availability_zone_id ⇒ String
The ID of the Availability Zone.
-
#connection_tracking_configuration ⇒ Types::ConnectionTrackingConfiguration
A security group connection tracking configuration that enables you to set the timeout for connection tracking on an Elastic network interface.
-
#deny_all_igw_traffic ⇒ Boolean
Indicates whether a network interface with an IPv6 address is unreachable from the public internet.
-
#description ⇒ String
A description.
-
#groups ⇒ Array<Types::GroupIdentifier>
Any security groups for the network interface.
- #id ⇒ String (also: #network_interface_id)
-
#interface_type ⇒ String
The type of network interface.
-
#ipv_4_prefixes ⇒ Array<Types::Ipv4PrefixSpecification>
The IPv4 prefixes that are assigned to the network interface.
-
#ipv_6_address ⇒ String
The IPv6 globally unique address associated with the network interface.
-
#ipv_6_addresses ⇒ Array<Types::NetworkInterfaceIpv6Address>
The IPv6 addresses associated with the network interface.
-
#ipv_6_native ⇒ Boolean
Indicates whether this is an IPv6 only network interface.
-
#ipv_6_prefixes ⇒ Array<Types::Ipv6PrefixSpecification>
The IPv6 prefixes that are assigned to the network interface.
-
#mac_address ⇒ String
The MAC address.
-
#operator ⇒ Types::OperatorResponse
The service provider that manages the network interface.
-
#outpost_arn ⇒ String
The Amazon Resource Name (ARN) of the Outpost.
-
#owner_id ⇒ String
The Amazon Web Services account ID of the owner of the network interface.
-
#private_dns_name ⇒ String
The private hostname.
-
#private_ip_address ⇒ String
The IPv4 address of the network interface within the subnet.
-
#private_ip_addresses ⇒ Array<Types::NetworkInterfacePrivateIpAddress>
The private IPv4 addresses associated with the network interface.
-
#public_dns_name ⇒ String
A public hostname.
-
#public_ip_dns_name_options ⇒ Types::PublicIpDnsNameOptions
Public hostname type options.
-
#requester_id ⇒ String
The alias or Amazon Web Services account ID of the principal or service that created the network interface.
-
#requester_managed ⇒ Boolean
Indicates whether the network interface is being managed by Amazon Web Services.
-
#source_dest_check ⇒ Boolean
Indicates whether source/destination checking is enabled.
-
#status ⇒ String
The status of the network interface.
-
#subnet_id ⇒ String
The ID of the subnet.
-
#tag_set ⇒ Array<Types::Tag>
Any tags assigned to the network interface.
-
#vpc_id ⇒ String
The ID of the VPC.
Actions collapse
- #assign_private_ip_addresses(options = {}) ⇒ Types::AssignPrivateIpAddressesResult
- #attach(options = {}) ⇒ Types::AttachNetworkInterfaceResult
- #create_tags(options = {}) ⇒ Tag::Collection
- #delete(options = {}) ⇒ EmptyStructure
- #delete_tags(options = {}) ⇒ Tag::Collection
- #describe_attribute(options = {}) ⇒ Types::DescribeNetworkInterfaceAttributeResult
- #detach(options = {}) ⇒ EmptyStructure
- #modify_attribute(options = {}) ⇒ EmptyStructure
- #reset_attribute(options = {}) ⇒ EmptyStructure
- #unassign_private_ip_addresses(options = {}) ⇒ EmptyStructure
Associations collapse
- #association ⇒ NetworkInterfaceAssociation?
- #identifiers ⇒ Object deprecated private Deprecated.
- #subnet ⇒ Subnet?
- #vpc ⇒ Vpc?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::NetworkInterface
Returns the data for this NetworkInterface.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ NetworkInterface
constructor
A new instance of NetworkInterface.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current NetworkInterface.
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::EC2::Client] #wait_until instead
Constructor Details
#initialize(id, options = {}) ⇒ NetworkInterface #initialize(options = {}) ⇒ NetworkInterface
Returns a new instance of NetworkInterface.
13 14 15 |
# File 'sig/network_interface.rbs', line 13
def initialize: (String id, Hash[Symbol, untyped] options) -> void
| (id: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#assign_private_ip_addresses(options = {}) ⇒ Types::AssignPrivateIpAddressesResult
125 |
# File 'sig/network_interface.rbs', line 125
def assign_private_ip_addresses: (
|
#associated_subnets ⇒ Array<String>
The subnets associated with this network interface.
106 |
# File 'sig/network_interface.rbs', line 106
def associated_subnets: () -> ::Array[::String]
|
#association ⇒ NetworkInterfaceAssociation?
240 |
# File 'sig/network_interface.rbs', line 240
def association: () -> NetworkInterfaceAssociation?
|
#attach(options = {}) ⇒ Types::AttachNetworkInterfaceResult
135 |
# File 'sig/network_interface.rbs', line 135
def attach: (
|
#attachment ⇒ Types::NetworkInterfaceAttachment
The network interface attachment.
22 |
# File 'sig/network_interface.rbs', line 22
def attachment: () -> Types::NetworkInterfaceAttachment
|
#availability_zone ⇒ String
The Availability Zone.
25 |
# File 'sig/network_interface.rbs', line 25
def availability_zone: () -> ::String
|
#availability_zone_id ⇒ String
The ID of the Availability Zone.
109 |
# File 'sig/network_interface.rbs', line 109
def availability_zone_id: () -> ::String
|
#client ⇒ Client
252 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 252
def client: () -> Client
|
#connection_tracking_configuration ⇒ Types::ConnectionTrackingConfiguration
A security group connection tracking configuration that enables you to set the timeout for connection tracking on an Elastic network interface. For more information, see Connection tracking timeouts in the Amazon EC2 User Guide.
28 |
# File 'sig/network_interface.rbs', line 28
def connection_tracking_configuration: () -> Types::ConnectionTrackingConfiguration
|
#create_tags(options = {}) ⇒ Tag::Collection
151 |
# File 'sig/network_interface.rbs', line 151
def create_tags: (
|
#data ⇒ Types::NetworkInterface
Returns the data for this Aws::EC2::NetworkInterface. Calls
Client#describe_network_interfaces if #data_loaded? is false.
118 |
# File 'sig/network_interface.rbs', line 118
def data: () -> Types::NetworkInterface
|
#data_loaded? ⇒ Boolean
121 |
# File 'sig/network_interface.rbs', line 121
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
175 |
# File 'sig/network_interface.rbs', line 175
def delete: (
|
#delete_tags(options = {}) ⇒ Tag::Collection
163 |
# File 'sig/network_interface.rbs', line 163
def delete_tags: (
|
#deny_all_igw_traffic ⇒ Boolean
Indicates whether a network interface with an IPv6 address is
unreachable from the public internet. If the value is true, inbound
traffic from the internet is dropped and you cannot assign an elastic
IP address to the network interface. The network interface is
reachable from peered VPCs and resources connected through a transit
gateway, including on-premises networks.
94 |
# File 'sig/network_interface.rbs', line 94
def deny_all_igw_traffic: () -> bool
|
#describe_attribute(options = {}) ⇒ Types::DescribeNetworkInterfaceAttributeResult
181 |
# File 'sig/network_interface.rbs', line 181
def describe_attribute: (
|
#description ⇒ String
A description.
31 |
# File 'sig/network_interface.rbs', line 31
def description: () -> ::String
|
#detach(options = {}) ⇒ EmptyStructure
188 |
# File 'sig/network_interface.rbs', line 188
def detach: (
|
#groups ⇒ Array<Types::GroupIdentifier>
Any security groups for the network interface.
34 |
# File 'sig/network_interface.rbs', line 34
def groups: () -> ::Array[Types::GroupIdentifier]
|
#id ⇒ String Also known as: network_interface_id
18 |
# File 'sig/network_interface.rbs', line 18
def id: () -> String
|
#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.
819 820 821 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 819 def identifiers { id: @id } end |
#interface_type ⇒ String
The type of network interface.
37 |
# File 'sig/network_interface.rbs', line 37
def interface_type: () -> ("interface" | "natGateway" | "efa" | "efa-only" | "trunk" | "load_balancer" | "network_load_balancer" | "vpc_endpoint" | "branch" | "transit_gateway" | "lambda" | "quicksight" | "global_accelerator_managed" | "api_gateway_managed" | "gateway_load_balancer" | "gateway_load_balancer_endpoint" | "iot_rules_managed" | "aws_codestar_connections_managed")
|
#ipv_4_prefixes ⇒ Array<Types::Ipv4PrefixSpecification>
The IPv4 prefixes that are assigned to the network interface.
67 |
# File 'sig/network_interface.rbs', line 67
def ipv_4_prefixes: () -> ::Array[Types::Ipv4PrefixSpecification]
|
#ipv_6_address ⇒ String
The IPv6 globally unique address associated with the network interface.
100 |
# File 'sig/network_interface.rbs', line 100
def ipv_6_address: () -> ::String
|
#ipv_6_addresses ⇒ Array<Types::NetworkInterfaceIpv6Address>
The IPv6 addresses associated with the network interface.
40 |
# File 'sig/network_interface.rbs', line 40
def ipv_6_addresses: () -> ::Array[Types::NetworkInterfaceIpv6Address]
|
#ipv_6_native ⇒ Boolean
Indicates whether this is an IPv6 only network interface.
97 |
# File 'sig/network_interface.rbs', line 97
def ipv_6_native: () -> bool
|
#ipv_6_prefixes ⇒ Array<Types::Ipv6PrefixSpecification>
The IPv6 prefixes that are assigned to the network interface.
70 |
# File 'sig/network_interface.rbs', line 70
def ipv_6_prefixes: () -> ::Array[Types::Ipv6PrefixSpecification]
|
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::NetworkInterface.
Returns self making it possible to chain methods.
network_interface.reload.data
114 |
# File 'sig/network_interface.rbs', line 114
def load: () -> self
|
#mac_address ⇒ String
The MAC address.
43 |
# File 'sig/network_interface.rbs', line 43
def mac_address: () -> ::String
|
#modify_attribute(options = {}) ⇒ EmptyStructure
195 |
# File 'sig/network_interface.rbs', line 195
def modify_attribute: (
|
#operator ⇒ Types::OperatorResponse
The service provider that manages the network interface.
103 |
# File 'sig/network_interface.rbs', line 103
def operator: () -> Types::OperatorResponse
|
#outpost_arn ⇒ String
The Amazon Resource Name (ARN) of the Outpost.
46 |
# File 'sig/network_interface.rbs', line 46
def outpost_arn: () -> ::String
|
#owner_id ⇒ String
The Amazon Web Services account ID of the owner of the network interface.
49 |
# File 'sig/network_interface.rbs', line 49
def owner_id: () -> ::String
|
#private_dns_name ⇒ String
The private hostname. For more information, see EC2 instance hostnames, DNS names, and domains in the Amazon EC2 User Guide.
52 |
# File 'sig/network_interface.rbs', line 52
def private_dns_name: () -> ::String
|
#private_ip_address ⇒ String
The IPv4 address of the network interface within the subnet.
61 |
# File 'sig/network_interface.rbs', line 61
def private_ip_address: () -> ::String
|
#private_ip_addresses ⇒ Array<Types::NetworkInterfacePrivateIpAddress>
The private IPv4 addresses associated with the network interface.
64 |
# File 'sig/network_interface.rbs', line 64
def private_ip_addresses: () -> ::Array[Types::NetworkInterfacePrivateIpAddress]
|
#public_dns_name ⇒ String
A public hostname. For more information, see EC2 instance hostnames, DNS names, and domains in the Amazon EC2 User Guide.
55 |
# File 'sig/network_interface.rbs', line 55
def public_dns_name: () -> ::String
|
#public_ip_dns_name_options ⇒ Types::PublicIpDnsNameOptions
Public hostname type options. For more information, see EC2 instance hostnames, DNS names, and domains in the Amazon EC2 User Guide.
58 |
# File 'sig/network_interface.rbs', line 58
def public_ip_dns_name_options: () -> Types::PublicIpDnsNameOptions
|
#requester_id ⇒ String
The alias or Amazon Web Services account ID of the principal or service that created the network interface.
73 |
# File 'sig/network_interface.rbs', line 73
def requester_id: () -> ::String
|
#requester_managed ⇒ Boolean
Indicates whether the network interface is being managed by Amazon Web Services.
76 |
# File 'sig/network_interface.rbs', line 76
def requester_managed: () -> bool
|
#reset_attribute(options = {}) ⇒ EmptyStructure
226 |
# File 'sig/network_interface.rbs', line 226
def reset_attribute: (
|
#source_dest_check ⇒ Boolean
Indicates whether source/destination checking is enabled.
79 |
# File 'sig/network_interface.rbs', line 79
def source_dest_check: () -> bool
|
#status ⇒ String
The status of the network interface.
82 |
# File 'sig/network_interface.rbs', line 82
def status: () -> ("available" | "associated" | "attaching" | "in-use" | "detaching")
|
#subnet_id ⇒ String
The ID of the subnet.
85 |
# File 'sig/network_interface.rbs', line 85
def subnet_id: () -> ::String
|
#tag_set ⇒ Array<Types::Tag>
Any tags assigned to the network interface.
88 |
# File 'sig/network_interface.rbs', line 88
def tag_set: () -> ::Array[Types::Tag]
|
#unassign_private_ip_addresses(options = {}) ⇒ EmptyStructure
233 |
# File 'sig/network_interface.rbs', line 233
def unassign_private_ip_addresses: (
|
#vpc_id ⇒ String
The ID of the VPC.
91 |
# File 'sig/network_interface.rbs', line 91
def vpc_id: () -> ::String
|
#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
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 366 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 |