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

L3 default support for Network Load Balancer #5059

Merged
merged 2 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,7 @@ objects:
- :TCP
- :UDP
- :GRPC
- :UNSPECIFIED
- !ruby/object:Api::Type::Enum
name: 'sessionAffinity'
description: |
Expand Down Expand Up @@ -3697,6 +3698,7 @@ objects:
- :AH
- :SCTP
- :ICMP
- :L3_DEFAULT
drebes marked this conversation as resolved.
Show resolved Hide resolved
# This is a multi-resource resource reference (BackendService (global), RegionBackendService)
# We have custom expands that manage this.
- !ruby/object:Api::Type::ResourceRef
Expand Down
8 changes: 8 additions & 0 deletions mmv1/products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,14 @@ overrides: !ruby/object:Overrides::ResourceOverrides
vars:
forwarding_rule_name: "website-forwarding-rule"
target_pool_name: "website-target-pool"
- !ruby/object:Provider::Terraform::Examples
name: "forwarding_rule_l3_default"
primary_resource_id: "fwd_rule"
vars:
forwarding_rule_name: "l3-forwarding-rule"
service_name: "service"
health_check_name: "health-check"
min_version: beta
- !ruby/object:Provider::Terraform::Examples
name: "forwarding_rule_internallb"
primary_resource_id: "default"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "google_compute_forwarding_rule" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
name = "<%= ctx[:vars]['forwarding_rule_name'] %>"
backend_service = google_compute_region_backend_service.service.id
ip_protocol = "L3_DEFAULT"
all_ports = true
}

resource "google_compute_region_backend_service" "service" {
provider = google-beta
region = "us-central1"
name = "<%= ctx[:vars]['service_name'] %>"
health_checks = [google_compute_region_health_check.health_check.id]
protocol = "UNSPECIFIED"
load_balancing_scheme = "EXTERNAL"
}

resource "google_compute_region_health_check" "health_check" {
provider = google-beta
name = "<%= ctx[:vars]['health_check_name'] %>"
region = "us-central1"

tcp_health_check {
port = 80
}
}