Class: Aws::EC2::Route
- Inherits:
-
Object
- Object
- Aws::EC2::Route
- Extended by:
- Deprecations
- Defined in:
- sig/route.rbs,
lib/aws-sdk-ec2/route.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#carrier_gateway_id ⇒ String
The ID of the carrier gateway.
-
#core_network_arn ⇒ String
The Amazon Resource Name (ARN) of the core network.
- #destination_cidr_block ⇒ String
-
#destination_ipv_6_cidr_block ⇒ String
The IPv6 CIDR block used for the destination match.
-
#destination_prefix_list_id ⇒ String
The prefix of the Amazon Web Services service.
-
#egress_only_internet_gateway_id ⇒ String
The ID of the egress-only internet gateway.
-
#gateway_id ⇒ String
The ID of a gateway attached to your VPC.
-
#instance_id ⇒ String
The ID of a NAT instance in your VPC.
-
#instance_owner_id ⇒ String
The ID of Amazon Web Services account that owns the instance.
-
#ip_address ⇒ String
The next hop IP address for routes propagated by VPC Route Server into VPC route tables.
-
#local_gateway_id ⇒ String
The ID of the local gateway.
-
#nat_gateway_id ⇒ String
The ID of a NAT gateway.
-
#network_interface_id ⇒ String
The ID of the network interface.
-
#odb_network_arn ⇒ String
The Amazon Resource Name (ARN) of the ODB network.
-
#origin ⇒ String
Describes how the route was created.
- #route_table_id ⇒ String
-
#state ⇒ String
The state of the route.
-
#transit_gateway_id ⇒ String
The ID of a transit gateway.
-
#vpc_peering_connection_id ⇒ String
The ID of a VPC peering connection.
Actions collapse
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #route_table ⇒ RouteTable
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Route
Returns the data for this Route.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(*args) ⇒ Route
constructor
A new instance of Route.
- #load ⇒ Object (also: #reload) private
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::EC2::Client] #wait_until instead
Constructor Details
#initialize(route_table_id, destination_cidr_block, options = {}) ⇒ Route #initialize(options = {}) ⇒ Route
Returns a new instance of Route.
13 14 15 |
# File 'sig/route.rbs', line 13
def initialize: (String route_table_id, String destination_cidr_block, Hash[Symbol, untyped] options) -> void
| (route_table_id: String, destination_cidr_block: String, ?client: Client) -> void
| (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#carrier_gateway_id ⇒ String
The ID of the carrier gateway.
51 |
# File 'sig/route.rbs', line 51
def carrier_gateway_id: () -> ::String
|
#core_network_arn ⇒ String
The Amazon Resource Name (ARN) of the core network.
66 |
# File 'sig/route.rbs', line 66
def core_network_arn: () -> ::String
|
#data ⇒ Types::Route
Returns the data for this Aws::EC2::Route.
78 |
# File 'sig/route.rbs', line 78
def data: () -> Types::Route
|
#data_loaded? ⇒ Boolean
81 |
# File 'sig/route.rbs', line 81
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
85 |
# File 'sig/route.rbs', line 85
def delete: (
|
#destination_cidr_block ⇒ String
21 |
# File 'sig/route.rbs', line 21
def destination_cidr_block: () -> String
|
#destination_ipv_6_cidr_block ⇒ String
The IPv6 CIDR block used for the destination match.
24 |
# File 'sig/route.rbs', line 24
def destination_ipv_6_cidr_block: () -> ::String
|
#destination_prefix_list_id ⇒ String
The prefix of the Amazon Web Services service.
27 |
# File 'sig/route.rbs', line 27
def destination_prefix_list_id: () -> ::String
|
#egress_only_internet_gateway_id ⇒ String
The ID of the egress-only internet gateway.
30 |
# File 'sig/route.rbs', line 30
def egress_only_internet_gateway_id: () -> ::String
|
#gateway_id ⇒ String
The ID of a gateway attached to your VPC.
33 |
# File 'sig/route.rbs', line 33
def gateway_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.
407 408 409 410 411 412 |
# File 'lib/aws-sdk-ec2/route.rb', line 407 def identifiers { route_table_id: @route_table_id, destination_cidr_block: @destination_cidr_block } end |
#instance_id ⇒ String
The ID of a NAT instance in your VPC.
36 |
# File 'sig/route.rbs', line 36
def instance_id: () -> ::String
|
#instance_owner_id ⇒ String
The ID of Amazon Web Services account that owns the instance.
39 |
# File 'sig/route.rbs', line 39
def instance_owner_id: () -> ::String
|
#ip_address ⇒ String
The next hop IP address for routes propagated by VPC Route Server into VPC route tables.
72 |
# File 'sig/route.rbs', line 72
def ip_address: () -> ::String
|
#load ⇒ Object Also known as: reload
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.
171 172 173 174 |
# File 'lib/aws-sdk-ec2/route.rb', line 171 def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end |
#local_gateway_id ⇒ String
The ID of the local gateway.
48 |
# File 'sig/route.rbs', line 48
def local_gateway_id: () -> ::String
|
#nat_gateway_id ⇒ String
The ID of a NAT gateway.
42 |
# File 'sig/route.rbs', line 42
def nat_gateway_id: () -> ::String
|
#network_interface_id ⇒ String
The ID of the network interface.
54 |
# File 'sig/route.rbs', line 54
def network_interface_id: () -> ::String
|
#odb_network_arn ⇒ String
The Amazon Resource Name (ARN) of the ODB network.
69 |
# File 'sig/route.rbs', line 69
def odb_network_arn: () -> ::String
|
#origin ⇒ String
Describes how the route was created.
-
CreateRouteTable- The route was automatically created when the route table was created. -
CreateRoute- The route was manually added to the route table. -
EnableVgwRoutePropagation- The route was propagated by route propagation. -
Advertisement- The route was created dynamically by Amazon VPC Route Server.
57 |
# File 'sig/route.rbs', line 57
def origin: () -> ("CreateRouteTable" | "CreateRoute" | "EnableVgwRoutePropagation" | "Advertisement")
|
#replace(options = {}) ⇒ EmptyStructure
93 |
# File 'sig/route.rbs', line 93
def replace: (
|
#route_table_id ⇒ String
18 |
# File 'sig/route.rbs', line 18
def route_table_id: () -> String
|
#state ⇒ String
The state of the route. The blackhole state indicates that the
route's target isn't available (for example, the specified gateway
isn't attached to the VPC, or the specified NAT instance has been
terminated).
60 |
# File 'sig/route.rbs', line 60
def state: () -> ("active" | "blackhole" | "filtered")
|
#transit_gateway_id ⇒ String
The ID of a transit gateway.
45 |
# File 'sig/route.rbs', line 45
def transit_gateway_id: () -> ::String
|
#vpc_peering_connection_id ⇒ String
The ID of a VPC peering connection.
63 |
# File 'sig/route.rbs', line 63
def vpc_peering_connection_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
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/aws-sdk-ec2/route.rb', line 272 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 |