Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EXTERNAL_MANAGED option to global forwarding rule and add example #5611

Merged
merged 2 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4274,13 +4274,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 @@ -1024,6 +1024,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"
}