Skip to main content

dtcloud_router_static_routes (Data Source)

Lists the static routes on a router, including any added outside Terraform.

Example Usage​

# Every route on the router, including any added outside Terraform.
data "dtcloud_router_static_routes" "edge" {
router_id = dtcloud_router.main.id
}

output "routes" {
value = {
for r in data.dtcloud_router_static_routes.edge.routes :
r.destination => r.next_hop
}
}

Schema​

Required​

  • router_id (String) ID of the router whose static routes are listed.

Read-Only​

  • id (String) The ID of this resource.
  • routes (List of Object) The router's static routes, in the order the platform holds them. (see below for nested schema)

Nested Schema for routes​

Read-Only:

  • destination (String)
  • next_hop (String)

Behaviour worth knowing​

  • The endpoint reports the two fields under different names from the ones used everywhere else in the provider. They are given back here under the names dtcloud_router_static_route uses, so the same route is called the same thing throughout.
  • Routes added outside Terraform are listed too, which is what this data source is for.