2014-08-26 23:50:29 +02:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_compute_route"
|
2015-10-23 16:10:41 +02:00
|
|
|
sidebar_current: "docs-google-compute-route"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
|
|
|
Manages a network route within GCE.
|
2014-08-26 23:50:29 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# google\_compute\_route
|
|
|
|
|
|
|
|
Manages a network route within GCE.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2014-08-26 23:50:29 +02:00
|
|
|
resource "google_compute_network" "foobar" {
|
2016-04-10 23:34:15 +02:00
|
|
|
name = "test"
|
|
|
|
ipv4_range = "10.0.0.0/16"
|
2014-08-26 23:50:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "google_compute_route" "foobar" {
|
2016-04-10 23:34:15 +02:00
|
|
|
name = "test"
|
|
|
|
dest_range = "15.0.0.0/24"
|
|
|
|
network = "${google_compute_network.foobar.name}"
|
|
|
|
next_hop_ip = "10.0.1.5"
|
|
|
|
priority = 100
|
2014-08-26 23:50:29 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
* `dest_range` - (Required) The destination IPv4 address range that this
|
|
|
|
route applies to.
|
|
|
|
|
2014-08-26 23:50:29 +02:00
|
|
|
* `name` - (Required) A unique name for the resource, required by GCE.
|
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
2016-09-03 11:51:20 +02:00
|
|
|
* `network` - (Required) The name or self_link of the network to attach this route to.
|
2014-08-26 23:50:29 +02:00
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
* `priority` - (Required) The priority of this route, used to break ties.
|
|
|
|
|
|
|
|
- - -
|
|
|
|
|
2016-11-01 14:45:36 +01:00
|
|
|
* `next_hop_gateway` - (Optional) The URL of the internet gateway to route
|
|
|
|
to if this route is matched. The alias "default-internet-gateway" can also
|
|
|
|
be used.
|
2014-08-26 23:50:29 +02:00
|
|
|
|
|
|
|
* `next_hop_instance` - (Optional) The name of the VM instance to route to
|
|
|
|
if this route is matched.
|
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
* `next_hop_instance_zone` - (Required when `next_hop_instance` is specified)
|
|
|
|
The zone of the instance specified in `next_hop_instance`.
|
2014-08-26 23:50:29 +02:00
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
* `next_hop_ip` - (Optional) The IP address of the next hop if this route
|
|
|
|
is matched.
|
2014-08-26 23:50:29 +02:00
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
* `next_hop_vpn_tunnel` - (Optional) The name of the VPN to route to if this
|
2015-09-04 22:54:18 +02:00
|
|
|
route is matched.
|
2016-03-31 12:37:17 +02:00
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
* `project` - (Optional) The project in which the resource belongs. If it
|
|
|
|
is not provided, the provider project is used.
|
2014-08-26 23:50:29 +02:00
|
|
|
|
|
|
|
* `tags` - (Optional) The tags that this route applies to.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
2016-04-10 23:34:15 +02:00
|
|
|
In addition to the arguments listed above, the following computed attributes are
|
|
|
|
exported:
|
2014-08-26 23:50:29 +02:00
|
|
|
|
|
|
|
* `next_hop_network` - The name of the next hop network, if available.
|
2016-04-10 23:34:15 +02:00
|
|
|
|
|
|
|
* `self_link` - The URI of the created resource.
|