oci.Core.getRouteTables
Explore with Pulumi AI
This data source provides the list of Route Tables in Oracle Cloud Infrastructure Core service.
Lists the route tables in the specified VCN and specified compartment. If the VCN ID is not provided, then the list includes the route tables from all VCNs in the specified compartment. The response includes the default route table that automatically comes with each VCN in the specified compartment, plus any route tables you’ve created.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testRouteTables = oci.Core.getRouteTables({
compartmentId: compartmentId,
displayName: routeTableDisplayName,
state: routeTableState,
vcnId: testVcn.id,
});
import pulumi
import pulumi_oci as oci
test_route_tables = oci.Core.get_route_tables(compartment_id=compartment_id,
display_name=route_table_display_name,
state=route_table_state,
vcn_id=test_vcn["id"])
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Core.GetRouteTables(ctx, &core.GetRouteTablesArgs{
CompartmentId: compartmentId,
DisplayName: pulumi.StringRef(routeTableDisplayName),
State: pulumi.StringRef(routeTableState),
VcnId: pulumi.StringRef(testVcn.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testRouteTables = Oci.Core.GetRouteTables.Invoke(new()
{
CompartmentId = compartmentId,
DisplayName = routeTableDisplayName,
State = routeTableState,
VcnId = testVcn.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetRouteTablesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var testRouteTables = CoreFunctions.getRouteTables(GetRouteTablesArgs.builder()
.compartmentId(compartmentId)
.displayName(routeTableDisplayName)
.state(routeTableState)
.vcnId(testVcn.id())
.build());
}
}
variables:
testRouteTables:
fn::invoke:
Function: oci:Core:getRouteTables
Arguments:
compartmentId: ${compartmentId}
displayName: ${routeTableDisplayName}
state: ${routeTableState}
vcnId: ${testVcn.id}
Using getRouteTables
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRouteTables(args: GetRouteTablesArgs, opts?: InvokeOptions): Promise<GetRouteTablesResult>
function getRouteTablesOutput(args: GetRouteTablesOutputArgs, opts?: InvokeOptions): Output<GetRouteTablesResult>
def get_route_tables(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[_core.GetRouteTablesFilter]] = None,
state: Optional[str] = None,
vcn_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRouteTablesResult
def get_route_tables_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetRouteTablesFilterArgs]]]] = None,
state: Optional[pulumi.Input[str]] = None,
vcn_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRouteTablesResult]
func GetRouteTables(ctx *Context, args *GetRouteTablesArgs, opts ...InvokeOption) (*GetRouteTablesResult, error)
func GetRouteTablesOutput(ctx *Context, args *GetRouteTablesOutputArgs, opts ...InvokeOption) GetRouteTablesResultOutput
> Note: This function is named GetRouteTables
in the Go SDK.
public static class GetRouteTables
{
public static Task<GetRouteTablesResult> InvokeAsync(GetRouteTablesArgs args, InvokeOptions? opts = null)
public static Output<GetRouteTablesResult> Invoke(GetRouteTablesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRouteTablesResult> getRouteTables(GetRouteTablesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Core/getRouteTables:getRouteTables
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string - The OCID of the compartment.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Filters
List<Get
Route Tables Filter> - State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Vcn
Id string - The OCID of the VCN.
- Compartment
Id string - The OCID of the compartment.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Filters
[]Get
Route Tables Filter - State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Vcn
Id string - The OCID of the VCN.
- compartment
Id String - The OCID of the compartment.
- display
Name String - A filter to return only resources that match the given display name exactly.
- filters
List<Get
Route Tables Filter> - state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- vcn
Id String - The OCID of the VCN.
- compartment
Id string - The OCID of the compartment.
- display
Name string - A filter to return only resources that match the given display name exactly.
- filters
Get
Route Tables Filter[] - state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- vcn
Id string - The OCID of the VCN.
- compartment_
id str - The OCID of the compartment.
- display_
name str - A filter to return only resources that match the given display name exactly.
- filters
Sequence[core.
Get Route Tables Filter] - state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- vcn_
id str - The OCID of the VCN.
- compartment
Id String - The OCID of the compartment.
- display
Name String - A filter to return only resources that match the given display name exactly.
- filters List<Property Map>
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- vcn
Id String - The OCID of the VCN.
getRouteTables Result
The following output properties are available:
- Compartment
Id string - The OCID of the compartment containing the route table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Route
Tables List<GetRoute Tables Route Table> - The list of route_tables.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
List<Get
Route Tables Filter> - State string
- The route table's current state.
- Vcn
Id string - The OCID of the VCN the route table list belongs to.
- Compartment
Id string - The OCID of the compartment containing the route table.
- Id string
- The provider-assigned unique ID for this managed resource.
- Route
Tables []GetRoute Tables Route Table - The list of route_tables.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
[]Get
Route Tables Filter - State string
- The route table's current state.
- Vcn
Id string - The OCID of the VCN the route table list belongs to.
- compartment
Id String - The OCID of the compartment containing the route table.
- id String
- The provider-assigned unique ID for this managed resource.
- route
Tables List<GetRoute Tables Route Table> - The list of route_tables.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
List<Get
Route Tables Filter> - state String
- The route table's current state.
- vcn
Id String - The OCID of the VCN the route table list belongs to.
- compartment
Id string - The OCID of the compartment containing the route table.
- id string
- The provider-assigned unique ID for this managed resource.
- route
Tables GetRoute Tables Route Table[] - The list of route_tables.
- display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Route Tables Filter[] - state string
- The route table's current state.
- vcn
Id string - The OCID of the VCN the route table list belongs to.
- compartment_
id str - The OCID of the compartment containing the route table.
- id str
- The provider-assigned unique ID for this managed resource.
- route_
tables Sequence[core.Get Route Tables Route Table] - The list of route_tables.
- display_
name str - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Sequence[core.
Get Route Tables Filter] - state str
- The route table's current state.
- vcn_
id str - The OCID of the VCN the route table list belongs to.
- compartment
Id String - The OCID of the compartment containing the route table.
- id String
- The provider-assigned unique ID for this managed resource.
- route
Tables List<Property Map> - The list of route_tables.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters List<Property Map>
- state String
- The route table's current state.
- vcn
Id String - The OCID of the VCN the route table list belongs to.
Supporting Types
GetRouteTablesFilter
GetRouteTablesRouteTable
- Compartment
Id string - The OCID of the compartment.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Dictionary<string, string>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Id string
- The route table's Oracle ID (OCID).
- Route
Rules List<GetRoute Tables Route Table Route Rule> - The collection of rules for routing destination IPs to network devices.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Time
Created string - The date and time the route table was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Id string - The OCID of the VCN.
- Compartment
Id string - The OCID of the compartment.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- Display
Name string - A filter to return only resources that match the given display name exactly.
- map[string]string
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- Id string
- The route table's Oracle ID (OCID).
- Route
Rules []GetRoute Tables Route Table Route Rule - The collection of rules for routing destination IPs to network devices.
- State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Time
Created string - The date and time the route table was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Id string - The OCID of the VCN.
- compartment
Id String - The OCID of the compartment.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display
Name String - A filter to return only resources that match the given display name exactly.
- Map<String,String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id String
- The route table's Oracle ID (OCID).
- route
Rules List<GetRoute Tables Route Table Route Rule> - The collection of rules for routing destination IPs to network devices.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created String - The date and time the route table was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id String - The OCID of the VCN.
- compartment
Id string - The OCID of the compartment.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display
Name string - A filter to return only resources that match the given display name exactly.
- {[key: string]: string}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id string
- The route table's Oracle ID (OCID).
- route
Rules GetRoute Tables Route Table Route Rule[] - The collection of rules for routing destination IPs to network devices.
- state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created string - The date and time the route table was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id string - The OCID of the VCN.
- compartment_
id str - The OCID of the compartment.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display_
name str - A filter to return only resources that match the given display name exactly.
- Mapping[str, str]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id str
- The route table's Oracle ID (OCID).
- route_
rules Sequence[core.Get Route Tables Route Table Route Rule] - The collection of rules for routing destination IPs to network devices.
- state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time_
created str - The date and time the route table was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn_
id str - The OCID of the VCN.
- compartment
Id String - The OCID of the compartment.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"}
- display
Name String - A filter to return only resources that match the given display name exactly.
- Map<String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"}
- id String
- The route table's Oracle ID (OCID).
- route
Rules List<Property Map> - The collection of rules for routing destination IPs to network devices.
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created String - The date and time the route table was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Id String - The OCID of the VCN.
GetRouteTablesRouteTableRouteRule
- Cidr
Block string - Deprecated. Instead use
destination
anddestinationType
. Requests that include bothcidrBlock
anddestination
will be rejected. - Description string
- An optional description of your choice for the rule.
- Destination string
- Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a
destinationType
. - Destination
Type string - Type of destination for the rule. Required if you provide a
destination
.CIDR_BLOCK
: If the rule'sdestination
is an IP address range in CIDR notation.SERVICE_CIDR_BLOCK
: If the rule'sdestination
is thecidrBlock
value for a Service (the rule is for traffic destined for a particularService
through a service gateway).
- Network
Entity stringId - The OCID for the route rule's target. For information about the type of targets you can specify, see Route Tables.
- Route
Type string - A route rule can be STATIC if manually added to the route table, LOCAL if added by Oracle Cloud Infrastructure to the route table.
- Cidr
Block string - Deprecated. Instead use
destination
anddestinationType
. Requests that include bothcidrBlock
anddestination
will be rejected. - Description string
- An optional description of your choice for the rule.
- Destination string
- Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a
destinationType
. - Destination
Type string - Type of destination for the rule. Required if you provide a
destination
.CIDR_BLOCK
: If the rule'sdestination
is an IP address range in CIDR notation.SERVICE_CIDR_BLOCK
: If the rule'sdestination
is thecidrBlock
value for a Service (the rule is for traffic destined for a particularService
through a service gateway).
- Network
Entity stringId - The OCID for the route rule's target. For information about the type of targets you can specify, see Route Tables.
- Route
Type string - A route rule can be STATIC if manually added to the route table, LOCAL if added by Oracle Cloud Infrastructure to the route table.
- cidr
Block String - Deprecated. Instead use
destination
anddestinationType
. Requests that include bothcidrBlock
anddestination
will be rejected. - description String
- An optional description of your choice for the rule.
- destination String
- Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a
destinationType
. - destination
Type String - Type of destination for the rule. Required if you provide a
destination
.CIDR_BLOCK
: If the rule'sdestination
is an IP address range in CIDR notation.SERVICE_CIDR_BLOCK
: If the rule'sdestination
is thecidrBlock
value for a Service (the rule is for traffic destined for a particularService
through a service gateway).
- network
Entity StringId - The OCID for the route rule's target. For information about the type of targets you can specify, see Route Tables.
- route
Type String - A route rule can be STATIC if manually added to the route table, LOCAL if added by Oracle Cloud Infrastructure to the route table.
- cidr
Block string - Deprecated. Instead use
destination
anddestinationType
. Requests that include bothcidrBlock
anddestination
will be rejected. - description string
- An optional description of your choice for the rule.
- destination string
- Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a
destinationType
. - destination
Type string - Type of destination for the rule. Required if you provide a
destination
.CIDR_BLOCK
: If the rule'sdestination
is an IP address range in CIDR notation.SERVICE_CIDR_BLOCK
: If the rule'sdestination
is thecidrBlock
value for a Service (the rule is for traffic destined for a particularService
through a service gateway).
- network
Entity stringId - The OCID for the route rule's target. For information about the type of targets you can specify, see Route Tables.
- route
Type string - A route rule can be STATIC if manually added to the route table, LOCAL if added by Oracle Cloud Infrastructure to the route table.
- cidr_
block str - Deprecated. Instead use
destination
anddestinationType
. Requests that include bothcidrBlock
anddestination
will be rejected. - description str
- An optional description of your choice for the rule.
- destination str
- Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a
destinationType
. - destination_
type str - Type of destination for the rule. Required if you provide a
destination
.CIDR_BLOCK
: If the rule'sdestination
is an IP address range in CIDR notation.SERVICE_CIDR_BLOCK
: If the rule'sdestination
is thecidrBlock
value for a Service (the rule is for traffic destined for a particularService
through a service gateway).
- network_
entity_ strid - The OCID for the route rule's target. For information about the type of targets you can specify, see Route Tables.
- route_
type str - A route rule can be STATIC if manually added to the route table, LOCAL if added by Oracle Cloud Infrastructure to the route table.
- cidr
Block String - Deprecated. Instead use
destination
anddestinationType
. Requests that include bothcidrBlock
anddestination
will be rejected. - description String
- An optional description of your choice for the rule.
- destination String
- Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a
destinationType
. - destination
Type String - Type of destination for the rule. Required if you provide a
destination
.CIDR_BLOCK
: If the rule'sdestination
is an IP address range in CIDR notation.SERVICE_CIDR_BLOCK
: If the rule'sdestination
is thecidrBlock
value for a Service (the rule is for traffic destined for a particularService
through a service gateway).
- network
Entity StringId - The OCID for the route rule's target. For information about the type of targets you can specify, see Route Tables.
- route
Type String - A route rule can be STATIC if manually added to the route table, LOCAL if added by Oracle Cloud Infrastructure to the route table.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.