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

LB module not setting balancing mode correctly. #34

Closed
jollymahn opened this issue Sep 6, 2024 · 3 comments · Fixed by #39
Closed

LB module not setting balancing mode correctly. #34

jollymahn opened this issue Sep 6, 2024 · 3 comments · Fixed by #39
Assignees
Labels
bug Something isn't working

Comments

@jollymahn
Copy link

Describe the bug

ERROR
problem occurs for both lb_internal and lb_external

module.vpc_peering["trust-to-spoke2"].google_compute_network_peering.peer: Creation complete after 1m7s [id=sj-az-lab-fw-spoke2-vpc/sj-az-lab-fw-spoke2-vpc-sj-az-lab-fw-trust-vpc]
╷
│ Error: Error creating RegionBackendService: googleapi: Error 400: Invalid value for field 'resource.backends[0].balancingMode': 'UTILIZATION'. Balancing mode must be CONNECTION for an INTERNAL backend service., invalid
│ 
│   with module.lb_internal["internal-lb"].google_compute_region_backend_service.this,
│   on ../../modules/lb_internal/main.tf line 10, in resource "google_compute_region_backend_service" "this":
│   10: resource "google_compute_region_backend_service" "this" {
│ 
╵

PERMALINK

RESOLUTION

dynamic "backend" {
   for_each = var.backends
   content {
     group    = backend.value
     failover = false
     balancing_mode = "CONNECTION"
   }
 }

Module Version

2.0.6

Terraform version

1.6.0

Expected behavior

successful LB deployment.

Current behavior

can not deploy load balancer frontend because backend not in supported mode.

Anything else to add?

dynamic "backend" {
for_each = var.backends
content {
group = backend.value
failover = false
balancing_mode = "CONNECTION"
}
}

@jollymahn jollymahn changed the title LB module not setting balancing mod correctly. LB module not setting balancing mode correctly. Sep 6, 2024
@pavelrn
Copy link
Contributor

pavelrn commented Sep 11, 2024

Hi @jollymahn ! What is terraform providers --version in your case?

@pavelrn pavelrn self-assigned this Sep 11, 2024
@jollymahn
Copy link
Author

jollymahn commented Sep 11, 2024 via email

@pavelrn
Copy link
Contributor

pavelrn commented Sep 12, 2024

There was a change in the terraform-provider-google version 6.0 default values that now requires explicitly set balancing_mode.
We need to adjust the module to be used with the newer provider version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment