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

Class: Aws::EC2::RouteTable

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(id, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

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

    Parameters:

    • id (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):

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

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

Instance Attribute Details

#idString (readonly)

Returns:

  • (String)

#owner_idString (readonly)

The ID of the AWS account that owns the route table.

Returns:

  • (String)

    The ID of the AWS account that owns the route table.

#propagating_vgwsArray<Types::PropagatingVgw> (readonly)

Any virtual private gateway (VGW) propagating routes.

Returns:

#route_table_idString (readonly)

The ID of the route table.

Returns:

  • (String)

    The ID of the route table.

#tagsArray<Types::Tag> (readonly)

Any tags assigned to the route table.

Returns:

  • (Array<Types::Tag>)

    Any tags assigned to the route table.

#vpc_idString (readonly)

The ID of the VPC.

Returns:

  • (String)

    The ID of the VPC.

Instance Method Details

#associate_with_subnet(options = {}) ⇒ RouteTableAssociation

Examples:

Request syntax example with placeholder values


routetable.associate_with_subnet({
  dry_run: false,
  subnet_id: "SubnetId",
  gateway_id: "RouteGatewayId",
})

Basic usage

routetableassociation = routetable.associate_with_subnet(options)
routetableassociation.id
#=> "routetableassociation-id"

Options Hash (options):

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

  • :subnet_id (String)

    The ID of the subnet.

  • :gateway_id (String)

    The ID of the internet gateway or virtual private gateway.

Returns:

See Also:

#associationsArray<RouteTableAssociation>?

Returns:

See Also:

#create_route(options = {}) ⇒ Route

Examples:

Request syntax example with placeholder values


routetable.create_route({
  destination_cidr_block: "String",
  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",
  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",
})

Basic usage

route = routetable.create_route(options)
route.destination_cidr_block
#=> "route-destination-cidr-block"

Options Hash (options):

  • :destination_cidr_block (String)

    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

  • :destination_ipv_6_cidr_block (String)

    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.

  • :destination_prefix_list_id (String)

    The ID of a prefix list used for the destination match.

  • :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 attached to your VPC.

  • :instance_id (String)

    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.

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

    The ID of the carrier gateway.

    You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.

  • :network_interface_id (String)

    The ID of a network interface.

  • :vpc_peering_connection_id (String)

    The ID of a VPC peering connection.

Returns:

See Also:

#create_tags(options = {}) ⇒ Array<Tag>

Examples:

Request syntax example with placeholder values


routetable.create_tags({
  dry_run: false,
  tags: [ # required
    {
      key: "String",
      value: "String",
    },
  ],
})

Basic usage

tags = routetable.create_tags(options)
tags.map(&:value)
#=> ["tag-value", ...]

Options Hash (options):

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

  • :tags (required, Array<Types::Tag>)

    The tags. The value parameter is required, but if you don\'t want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

Returns:

See Also:

#delete(options = {}) ⇒ Struct

Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.

Examples:

Request syntax example with placeholder values


routetable.delete({
  dry_run: false,
})

Options Hash (options):

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

#delete_tags(options = {}) ⇒ Array<Tag>

Examples:

Request syntax example with placeholder values


routetable.delete_tags({
  dry_run: false,
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

Basic usage

tags = routetable.delete_tags(options)
tags.map(&:value)
#=> ["tag-value", ...]

Options Hash (options):

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

  • :tags (Array<Types::Tag>)

    The tags to delete. Specify a tag key and an optional tag value to delete specific tags. If you specify a tag key without a tag value, we delete any tag with this key regardless of its value. If you specify a tag key with an empty string as the tag value, we delete the tag only if its value is an empty string.

    If you omit this parameter, we delete all user-defined tags for the specified resources. We do not delete AWS-generated tags (tags that have the aws: prefix).

Returns:

See Also:

#routesArray<Route>?

Returns:

See Also:

#vpcVpc?

Returns: