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

Rodriguezsergio/fix https proxy resource #2779

Closed
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
2 changes: 1 addition & 1 deletion blueprints/apigee/apigee-x-foundations/northbound.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module "ext_lb" {
use_classic_version = false
backend_service_configs = {
default = {
backends = [for k, v in local.ext_instances : { backend = google_compute_region_network_endpoint_group.psc_negs[k].id }]
backends = [for k, v in local.ext_instances : { group = google_compute_region_network_endpoint_group.psc_negs[k].id }]
protocol = "HTTPS"
health_checks = []
outlier_detection = var.ext_lb_config.outlier_detection
Expand Down
2 changes: 1 addition & 1 deletion blueprints/apigee/bigquery-analytics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module "glb" {
use_classic_version = false
backend_service_configs = {
default = {
backends = [for k, v in var.instances : { backend = k }]
backends = [for k, v in var.instances : { group = k }]
protocol = "HTTPS"
health_checks = []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module "glb" {
use_classic_version = false
backend_service_configs = {
default = {
backends = [{ backend = "neg-0" }]
backends = [{ group = "neg-0" }]
protocol = "HTTPS"
health_checks = []
}
Expand Down
2 changes: 1 addition & 1 deletion blueprints/cloud-operations/adfs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module "glb" {
protocol = "HTTPS"
backend_service_configs = {
default = {
backends = [{ backend = module.server.group.id }]
backends = [{ group = module.server.group.id }]
log_sample_rate = 1
protocol = "HTTPS"
}
Expand Down
4 changes: 2 additions & 2 deletions blueprints/networking/glb-and-armor/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ module "glb" {
backend_service_configs = {
default = {
backends = [
{ backend = module.mig_ew1.group_manager.instance_group },
{ backend = module.mig_ue1.group_manager.instance_group }
{ group = module.mig_ew1.group_manager.instance_group },
{ group = module.mig_ue1.group_manager.instance_group }
]
log_sample_rate = 1
security_policy = try(google_compute_security_policy.policy[0].name, null)
Expand Down
4 changes: 2 additions & 2 deletions blueprints/networking/glb-hybrid-neg-internal/glb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ module "hybrid-glb" {
default = {
backends = [
{
backend = "neg-primary"
group = "neg-primary"
balancing_mode = "RATE"
max_rate = { per_endpoint = 100 }
},
{
backend = "neg-secondary"
group = "neg-secondary"
balancing_mode = "RATE"
max_rate = { per_endpoint = 100 }
}
Expand Down
4 changes: 2 additions & 2 deletions blueprints/networking/psc-glb-and-armor/consumer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ module "glb" {
backend_service_configs = {
default = {
backends = [
{ backend = "neg-a" }
{ group = "neg-a" }
]
health_checks = []
protocol = "HTTPS"
security_policy = google_compute_security_policy.cloud-armor-policy.name
}
other = {
backends = [
{ backend = "neg-b" }
{ group = "neg-b" }
]
health_checks = []
protocol = "HTTPS"
Expand Down
2 changes: 1 addition & 1 deletion blueprints/serverless/cloud-run-explore/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module "glb" {
backend_service_configs = {
default = {
backends = [
{ backend = "neg-0" }
{ group = "neg-0" }
]
health_checks = []
port_name = "http"
Expand Down
2 changes: 1 addition & 1 deletion blueprints/third-party-solutions/phpipam/glb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module "glb" {
backend_service_configs = {
default = {
backends = [
{ backend = "phpipam" }
{ group = "phpipam" }
]
health_checks = []
port_name = "http"
Expand Down
46 changes: 23 additions & 23 deletions modules/net-lb-app-ext-regional/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/net-lb-app-ext-regional/backend-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resource "google_compute_region_backend_service" "default" {
timeout_sec = each.value.timeout_sec

dynamic "backend" {
for_each = { for b in coalesce(each.value.backends, []) : b.backend => b }
for_each = { for b in coalesce(each.value.backends, []) : b.group => b }
content {
group = lookup(local.group_ids, backend.key, backend.key)
balancing_mode = backend.value.balancing_mode # UTILIZATION, RATE
Expand Down
4 changes: 2 additions & 2 deletions modules/net-lb-app-ext-regional/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ resource "google_compute_region_target_https_proxy" "default" {
name = var.name
region = var.region
description = var.description
certificate_manager_certificates = var.https_proxy_config.certificate_manager_certificates
ssl_certificates = local.proxy_ssl_certificates
ssl_policy = var.https_proxy_config.ssl_policy
url_map = google_compute_region_url_map.default.id
ssl_certificates = length(local.proxy_ssl_certificates) == 0 ? null : local.proxy_ssl_certificates
certificate_manager_certificates = try(var.https_proxy_config.certificate_manager_certificates, null)
}
3 changes: 1 addition & 2 deletions modules/net-lb-app-ext-regional/variables-backend-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ variable "backend_service_configs" {
session_affinity = optional(string)
timeout_sec = optional(number)
backends = list(object({
# group renamed to backend
backend = string
group = string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not change this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names are not consistent across modules.

There are missing properties across modules as well. Can you elaborate why standardizing on 1 name is not advised?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some properties are missing because different load balancera support different features.

I would not touch those modules, they are very complex and delicate and have worked well for a long time.

balancing_mode = optional(string, "UTILIZATION")
capacity_scaler = optional(number, 1)
description = optional(string, "Terraform managed.")
Expand Down
64 changes: 32 additions & 32 deletions modules/net-lb-app-ext/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/net-lb-app-ext/backend-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ resource "google_compute_backend_service" "default" {
timeout_sec = each.value.timeout_sec

dynamic "backend" {
for_each = { for b in coalesce(each.value.backends, []) : b.backend => b }
for_each = { for b in coalesce(each.value.backends, []) : b.group => b }
content {
group = lookup(local.group_ids, backend.key, backend.key)
balancing_mode = backend.value.balancing_mode # UTILIZATION, RATE
Expand Down
4 changes: 2 additions & 2 deletions modules/net-lb-app-ext/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ resource "google_compute_target_https_proxy" "default" {
name = var.name
description = var.description
certificate_map = var.https_proxy_config.certificate_map
certificate_manager_certificates = var.https_proxy_config.certificate_manager_certificates
quic_override = var.https_proxy_config.quic_override
ssl_certificates = local.proxy_ssl_certificates
ssl_policy = var.https_proxy_config.ssl_policy
url_map = google_compute_url_map.default.id
server_tls_policy = var.https_proxy_config.mtls_policy
ssl_certificates = length(local.proxy_ssl_certificates) == 0 ? null : local.proxy_ssl_certificates
certificate_manager_certificates = try(var.https_proxy_config.certificate_manager_certificates, null)
}
3 changes: 1 addition & 2 deletions modules/net-lb-app-ext/variables-backend-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ variable "backend_service_configs" {
session_affinity = optional(string)
timeout_sec = optional(number)
backends = list(object({
# group renamed to backend
backend = string
group = string
balancing_mode = optional(string, "UTILIZATION")
capacity_scaler = optional(number, 1)
description = optional(string, "Terraform managed.")
Expand Down
Loading
Loading