From 913638b1fff3f7d52d07ea738313d7df108cff84 Mon Sep 17 00:00:00 2001 From: Alex Ellis Date: Tue, 11 Jan 2022 15:46:49 -0500 Subject: [PATCH] Add EXTERNAL_MANAGED as load_balancing_scheme for google_compute_backend_service (#5596) --- mmv1/products/compute/api.yaml | 1 + mmv1/products/compute/terraform.yaml | 7 +++++++ .../backend_service_external_managed.tf.erb | 14 ++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 mmv1/templates/terraform/examples/backend_service_external_managed.tf.erb diff --git a/mmv1/products/compute/api.yaml b/mmv1/products/compute/api.yaml index 596bd69fee51..effb72038151 100644 --- a/mmv1/products/compute/api.yaml +++ b/mmv1/products/compute/api.yaml @@ -1369,6 +1369,7 @@ objects: values: - :EXTERNAL - :INTERNAL_SELF_MANAGED + - :EXTERNAL_MANAGED - !ruby/object:Api::Type::Enum name: 'localityLbPolicy' values: diff --git a/mmv1/products/compute/terraform.yaml b/mmv1/products/compute/terraform.yaml index 2983d91e745f..5faff870e15a 100644 --- a/mmv1/products/compute/terraform.yaml +++ b/mmv1/products/compute/terraform.yaml @@ -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' diff --git a/mmv1/templates/terraform/examples/backend_service_external_managed.tf.erb b/mmv1/templates/terraform/examples/backend_service_external_managed.tf.erb new file mode 100644 index 000000000000..7b51c837c2d3 --- /dev/null +++ b/mmv1/templates/terraform/examples/backend_service_external_managed.tf.erb @@ -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 + } +}