oci_core_route_table

This resource provides the Route Table resource in Oracle Cloud Infrastructure Core service.

Creates a new route table for the specified VCN. In the request you must also include at least one route rule for the new route table. For information on the number of rules you can have in a route table, see Service Limits. For general information about route tables in your VCN and the types of targets you can use in route rules, see Route Tables.

For the purposes of access control, you must provide the OCID of the compartment where you want the route table to reside. Notice that the route table doesn’t have to be in the same compartment as the VCN, subnets, or other Networking Service components. If you’re not sure which compartment to use, put the route table in the same compartment as the VCN. For more information about compartments and access control, see Overview of the IAM Service. For information about OCIDs, see Resource Identifiers.

You may optionally specify a display name for the route table, otherwise a default is provided. It does not have to be unique, and you can change it. Avoid entering confidential information.

For more information on configuring a VCN’s default route table, see Managing Default VCN Resources

Example Usage

resource "oci_core_route_table" "test_route_table" {
	#Required
	compartment_id = var.compartment_id
	vcn_id = oci_core_vcn.test_vcn.id

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	display_name = var.route_table_display_name
	freeform_tags = {"Department"= "Finance"}
	route_rules {
		#Required
		network_entity_id = oci_core_internet_gateway.test_internet_gateway.id

		#Optional
		cidr_block = var.route_table_route_rules_cidr_block
		description = var.route_table_route_rules_description
		destination = var.route_table_route_rules_destination
		destination_type = var.route_table_route_rules_destination_type
	}
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Route Table * update - (Defaults to 20 minutes), when updating the Route Table * delete - (Defaults to 20 minutes), when destroying the Route Table

Import

RouteTables can be imported using the id, e.g.

$ terraform import oci_core_route_table.test_route_table "id"