Skip to content

Commit

Permalink
Add EXTERNAL_MANAGED option to global forwarding rule and add example (
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Ellis authored and betsy-lichtenberg committed Apr 25, 2022
1 parent fc5a4ea commit 5fd3c49
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4264,13 +4264,15 @@ objects:
The value of INTERNAL_SELF_MANAGED means that this will be used for
Internal Global HTTP(S) LB. The value of EXTERNAL means that this
will be used for External Global Load Balancing (HTTP(S) LB,
External TCP/UDP LB, SSL Proxy)
External TCP/UDP LB, SSL Proxy). The value of EXTERNAL_MANAGED means
that this will be used for Global external HTTP(S) load balancers.

([Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) only) Note: This field must be set "" if the global address is
configured as a purpose of PRIVATE_SERVICE_CONNECT and addressType of INTERNAL.
default_value: :EXTERNAL
values:
- :EXTERNAL
- :EXTERNAL_MANAGED
- :INTERNAL_SELF_MANAGED
- !ruby/object:Api::Type::Array
name: 'metadataFilters'
Expand Down
11 changes: 11 additions & 0 deletions mmv1/products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,17 @@ overrides: !ruby/object:Overrides::ResourceOverrides
ignore_read_extra:
- "port_range"
- "target"
- !ruby/object:Provider::Terraform::Examples
name: "global_forwarding_rule_external_managed"
min_version: beta
primary_resource_id: "default"
vars:
forwarding_rule_name: "global-rule"
http_proxy_name: "target-proxy"
backend_service_name: "backend"
ignore_read_extra:
- "port_range"
- "target"
- !ruby/object:Provider::Terraform::Examples
name: "private_service_connect_google_apis"
min_version: beta
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
resource "google_compute_global_forwarding_rule" "default" {
provider = google-beta
name = "<%= ctx[:vars]['forwarding_rule_name'] %>"
target = google_compute_target_http_proxy.default.id
port_range = "80"
load_balancing_scheme = "EXTERNAL_MANAGED"
}

resource "google_compute_target_http_proxy" "default" {
provider = google-beta
name = "<%= ctx[:vars]['http_proxy_name'] %>"
description = "a description"
url_map = google_compute_url_map.default.id
}

resource "google_compute_url_map" "default" {
provider = google-beta
name = "url-map-<%= ctx[:vars]['http_proxy_name'] %>"
description = "a description"
default_service = google_compute_backend_service.default.id

host_rule {
hosts = ["mysite.com"]
path_matcher = "allpaths"
}

path_matcher {
name = "allpaths"
default_service = google_compute_backend_service.default.id

path_rule {
paths = ["/*"]
service = google_compute_backend_service.default.id
}
}
}

resource "google_compute_backend_service" "default" {
provider = google-beta
name = "<%= ctx[:vars]['backend_service_name'] %>"
port_name = "http"
protocol = "HTTP"
timeout_sec = 10
load_balancing_scheme = "EXTERNAL_MANAGED"
}

0 comments on commit 5fd3c49

Please sign in to comment.