-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend service support for internet NEG backend (#3782)
* Add ability to set global network endpoint group as backend for backend service. Make health_checks optional * PR fixes * Add encoder to remove max_utilization when neg backend * Check for global NEG in group to remove max_utilization * Add another nil check * Spacing * Docs fix
- Loading branch information
Showing
4 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
templates/terraform/examples/backend_service_network_endpoint.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
resource "google_compute_global_network_endpoint_group" "external_proxy" { | ||
name = "<%= ctx[:vars]['neg_name'] %>" | ||
network_endpoint_type = "INTERNET_FQDN_PORT" | ||
default_port = "443" | ||
} | ||
|
||
resource "google_compute_global_network_endpoint" "proxy" { | ||
global_network_endpoint_group = google_compute_global_network_endpoint_group.external_proxy.id | ||
fqdn = "test.example.com" | ||
port = google_compute_global_network_endpoint_group.external_proxy.default_port | ||
} | ||
|
||
resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['backend_service_name'] %>" | ||
enable_cdn = true | ||
timeout_sec = 10 | ||
connection_draining_timeout_sec = 10 | ||
|
||
custom_request_headers = ["host: ${google_compute_global_network_endpoint.proxy.fqdn}"] | ||
|
||
backend { | ||
group = google_compute_global_network_endpoint_group.external_proxy.id | ||
} | ||
} |