Skip to content

Commit

Permalink
Add EXTERNAL_MANAGED as load_balancing_scheme for google_compute_back…
Browse files Browse the repository at this point in the history
…end_service (GoogleCloudPlatform#5596)
  • Loading branch information
AlexanderEllis authored and lcaggio committed Mar 16, 2022
1 parent 227d9d7 commit 913638b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ objects:
values:
- :EXTERNAL
- :INTERNAL_SELF_MANAGED
- :EXTERNAL_MANAGED
- !ruby/object:Api::Type::Enum
name: 'localityLbPolicy'
values:
Expand Down
7 changes: 7 additions & 0 deletions mmv1/products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ overrides: !ruby/object:Overrides::ResourceOverrides
vars:
backend_service_name: "backend-service"
neg_name: "network-endpoint"
- !ruby/object:Provider::Terraform::Examples
name: "backend_service_external_managed"
min_version: beta
primary_resource_id: "default"
vars:
backend_service_name: "backend-service"
health_check_name: "health-check"
custom_code: !ruby/object:Provider::Terraform::CustomCode
constants: 'templates/terraform/constants/backend_service.go.erb'
encoder: 'templates/terraform/encoders/backend_service.go.erb'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
name = "<%= ctx[:vars]['backend_service_name'] %>"
health_checks = [google_compute_health_check.default.id]
load_balancing_scheme = "EXTERNAL_MANAGED"
}

resource "google_compute_health_check" "default" {
provider = google-beta
name = "<%= ctx[:vars]['health_check_name'] %>"
http_health_check {
port = 80
}
}

0 comments on commit 913638b

Please sign in to comment.