From ecf46bbb30f6c109ca52098ec9e128bc07dea08a Mon Sep 17 00:00:00 2001 From: Madan Kapoor Date: Mon, 26 Aug 2019 16:35:58 +0000 Subject: [PATCH] Adding next_hop_ilb attribute to compute route resource Signed-off-by: Modular Magician --- google/resource_compute_route.go | 1 + website/docs/r/compute_route.html.markdown | 62 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/google/resource_compute_route.go b/google/resource_compute_route.go index 06f5a453531..a8adac8713b 100644 --- a/google/resource_compute_route.go +++ b/google/resource_compute_route.go @@ -77,6 +77,7 @@ func resourceComputeRoute() *schema.Resource { }, "next_hop_ip": { Type: schema.TypeString, + Computed: true, Optional: true, ForceNew: true, }, diff --git a/website/docs/r/compute_route.html.markdown b/website/docs/r/compute_route.html.markdown index 55fcd330f61..a0cc875881d 100644 --- a/website/docs/r/compute_route.html.markdown +++ b/website/docs/r/compute_route.html.markdown @@ -71,6 +71,68 @@ resource "google_compute_network" "default" { name = "compute-network" } ``` + +## 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" "route-ilb-beta" { + 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