You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::EC2::Route

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(route_table_id, destination_cidr_block, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(route_table_id, destination_cidr_block, options = {}) ⇒ Object

    Parameters:

    • route_table_id (String)
    • destination_cidr_block (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :route_table_id (required, String)
    • :destination_cidr_block (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#carrier_gateway_idString (readonly)

The ID of the carrier gateway.

Returns:

  • (String)

    The ID of the carrier gateway.

#destination_cidr_blockString (readonly)

Returns:

  • (String)

#destination_ipv_6_cidr_blockString (readonly)

The IPv6 CIDR block used for the destination match.

Returns:

  • (String)

    The IPv6 CIDR block used for the destination match.

#destination_prefix_list_idString (readonly)

The prefix of the AWS service.

Returns:

  • (String)

    The prefix of the AWS service.

#egress_only_internet_gateway_idString (readonly)

The ID of the egress-only internet gateway.

Returns:

  • (String)

    The ID of the egress-only internet gateway.

#gateway_idString (readonly)

The ID of a gateway attached to your VPC.

Returns:

  • (String)

    The ID of a gateway attached to your VPC.

#instance_idString (readonly)

The ID of a NAT instance in your VPC.

Returns:

  • (String)

    The ID of a NAT instance in your VPC.

#instance_owner_idString (readonly)

The AWS account ID of the owner of the instance.

Returns:

  • (String)

    The AWS account ID of the owner of the instance.

#local_gateway_idString (readonly)

The ID of the local gateway.

Returns:

  • (String)

    The ID of the local gateway.

#nat_gateway_idString (readonly)

The ID of a NAT gateway.

Returns:

  • (String)

    The ID of a NAT gateway.

#network_interface_idString (readonly)

The ID of the network interface.

Returns:

  • (String)

    The ID of the network interface.

#originString (readonly)

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.

    Possible values:

    • CreateRouteTable
    • CreateRoute
    • EnableVgwRoutePropagation

Returns:

  • (String)

    Describes how the route was created.

#route_table_idString (readonly)

Returns:

  • (String)

#stateString (readonly)

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

Possible values:

  • active
  • blackhole

Returns:

  • (String)

    The state of the route.

#transit_gateway_idString (readonly)

The ID of a transit gateway.

Returns:

  • (String)

    The ID of a transit gateway.

#vpc_peering_connection_idString (readonly)

The ID of a VPC peering connection.

Returns:

  • (String)

    The ID of a VPC peering connection.

Instance Method Details

#delete(options = {}) ⇒ Struct

Deletes the specified route from the specified route table.

Examples:

Request syntax example with placeholder values


route.delete({
  destination_ipv_6_cidr_block: "String",
  destination_prefix_list_id: "PrefixListResourceId",
  dry_run: false,
})

Options Hash (options):

  • :destination_ipv_6_cidr_block (String)

    The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.

  • :destination_prefix_list_id (String)

    The ID of the prefix list for the route.

  • :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:

  • (Struct)

    Returns an empty response.

See Also:

#replace(options = {}) ⇒ Struct

Replaces an existing route within a route table in a VPC. You must provide only one of the following: internet gateway, virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, egress-only internet gateway, or transit gateway.

For more information, see Route Tables in the Amazon Virtual Private Cloud User Guide.

Examples:

Request syntax example with placeholder values


route.replace({
  destination_ipv_6_cidr_block: "String",
  destination_prefix_list_id: "PrefixListResourceId",
  dry_run: false,
  vpc_endpoint_id: "VpcEndpointId",
  egress_only_internet_gateway_id: "EgressOnlyInternetGatewayId",
  gateway_id: "RouteGatewayId",
  instance_id: "InstanceId",
  local_target: false,
  nat_gateway_id: "NatGatewayId",
  transit_gateway_id: "TransitGatewayId",
  local_gateway_id: "LocalGatewayId",
  carrier_gateway_id: "CarrierGatewayId",
  network_interface_id: "NetworkInterfaceId",
  vpc_peering_connection_id: "VpcPeeringConnectionId",
})

Options Hash (options):

  • :destination_ipv_6_cidr_block (String)

    The IPv6 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.

  • :destination_prefix_list_id (String)

    The ID of the prefix list for the route.

  • :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.

  • :vpc_endpoint_id (String)

    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.

  • :egress_only_internet_gateway_id (String)

    [IPv6 traffic only] The ID of an egress-only internet gateway.

  • :gateway_id (String)

    The ID of an internet gateway or virtual private gateway.

  • :instance_id (String)

    The ID of a NAT instance in your VPC.

  • :local_target (Boolean)

    Specifies whether to reset the local route to its default target (local).

  • :nat_gateway_id (String)

    [IPv4 traffic only] The ID of a NAT gateway.

  • :transit_gateway_id (String)

    The ID of a transit gateway.

  • :local_gateway_id (String)

    The ID of the local gateway.

  • :carrier_gateway_id (String)

    [IPv4 traffic only] The ID of a carrier gateway.

  • :network_interface_id (String)

    The ID of a network interface.

  • :vpc_peering_connection_id (String)

    The ID of a VPC peering connection.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#route_tableRouteTable

Returns: