terraform-google-modules / terraform-google-lb-http

Creates a global HTTP load balancer for Compute Engine by using forwarding rules
https://registry.terraform.io/modules/terraform-google-modules/lb-http/google
Apache License 2.0
319 stars 365 forks source link

fix: make `iap_config` `log_config` optional and set `enable_cdn` default value to `false` #434

Open ushuz opened 4 months ago

ushuz commented 4 months ago

Make these configs truly optional to avoid Terraform complaining:

Step #1 - "terraform-plan": Error: Invalid value for input variable
Step #1 - "terraform-plan": 
Step #1 - "terraform-plan":   on cloudrun.tf line 193, in module "lb":
Step #1 - "terraform-plan":  193:   backends = {
Step #1 - "terraform-plan":  194:     default = {
Step #1 - "terraform-plan":  195:       groups = [
Step #1 - "terraform-plan":  196:         {
Step #1 - "terraform-plan":  197:           group = google_compute_region_network_endpoint_group.neg.id
Step #1 - "terraform-plan":  198:         }
Step #1 - "terraform-plan":  199:       ]
Step #1 - "terraform-plan":  200:     }
Step #1 - "terraform-plan":  201:   }
Step #1 - "terraform-plan": 
Step #1 - "terraform-plan": The given value is not suitable for module.lb.var.backends declared at .terraform/modules/lb/modules/serverless_negs/variables.tf:58,1-20: "terraform-plan": element "default": attributes "iap_config" and "log_config" are required.
Step #1 - "terraform-plan": Error: Null condition
Step #1 - "terraform-plan": 
Step #1 - "terraform-plan":   on .terraform/modules/lb/modules/serverless_negs/main.tf line 238, in resource "google_compute_backend_service" "default":
Step #1 - "terraform-plan":  238:     for_each = each.value.enable_cdn ? [1] : []
Step #1 - "terraform-plan":     ├────────────────
Step #1 - "terraform-plan":     │ each.value.enable_cdn is null
Step #1 - "terraform-plan": 
Step #1 - "terraform-plan": The condition value is null. Conditions must either be true or false.
imrannayer commented 4 months ago

@ushuz thx for the PR. Can you plz follow contribution guide to update template and generate terraform?

Thanks

ushuz commented 4 months ago

@imrannayer - Updated, thanks.

imrannayer commented 4 months ago

/gcbrun

imrannayer commented 3 months ago

@ushuz test are failing on image. Can you plz update all image family with the ones available.

gcloud compute images list
  with module.example.module.mig2_template.google_compute_instance_template.tpl,
  on .terraform/modules/example.mig2_template/modules/instance_template/main.tf line 62, in resource "google_compute_instance_template" "tpl":
  62: resource "google_compute_instance_template" "tpl" {

Error: Error resolving image name 'centos-cloud/centos-7': Could not find image or family centos-cloud/centos-7
ushuz commented 3 months ago

@imrannayer - Update the branch

imrannayer commented 3 months ago

@imrannayer - Update the branch

@ushuz can u update all the example folder pointing to centos7. Change them to centos-stream-9

ushuz commented 3 months ago

@imrannayer - Sorry, I don't know how to do that. Can you update the branch directly? It's editable by the maintainers.

image