Skip to content

Commit

Permalink
Adding next_hop_ilb attribute to compute route resource
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
Madankapoor authored and modular-magician committed Aug 21, 2019
1 parent 70af5e0 commit 221aaf0
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions google/resource_compute_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func resourceComputeRoute() *schema.Resource {
},
"next_hop_ip": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
},
Expand Down
62 changes: 62 additions & 0 deletions website/docs/r/compute_route.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,68 @@ resource "google_compute_network" "default" {
name = "compute-network"
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgit.luolix.top%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=route_ilb_beta&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Route Ilb Beta


```hcl
resource "google_compute_network" "default" {
provider = "google-beta"
name = "compute-network"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "default" {
provider = "google-beta"
name = "compute-subnet"
ip_cidr_range = "10.0.1.0/24"
region = "us-central1"
network = "${google_compute_network.default.self_link}"
}
resource "google_compute_health_check" "hc" {
provider = "google-beta"
name = "proxy-health-check"
check_interval_sec = 1
timeout_sec = 1
tcp_health_check {
port = "80"
}
}
resource "google_compute_region_backend_service" "backend" {
provider = "google-beta"
name = "compute-backend"
region = "us-central1"
health_checks = ["${google_compute_health_check.hc.self_link}"]
}
resource "google_compute_forwarding_rule" "default" {
provider = "google-beta"
name = "compute-forwarding-rule"
region = "us-central1"
load_balancing_scheme = "INTERNAL"
backend_service = "${google_compute_region_backend_service.backend.self_link}"
all_ports = true
network = "${google_compute_network.default.name}"
subnetwork = "${google_compute_subnetwork.default.name}"
}
resource "google_compute_route" "default" {
provider = "google-beta"
name = "route-ilb-beta"
dest_range = "0.0.0.0/0"
network = "${google_compute_network.default.name}"
next_hop_ilb = "${google_compute_forwarding_rule.default.self_link}"
priority = 2000
}
```

## Argument Reference

Expand Down

0 comments on commit 221aaf0

Please sign in to comment.