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
315 stars 362 forks source link

Custom url_map resource inside the module #430

Open eitchugo opened 4 months ago

eitchugo commented 4 months ago

TL;DR

I'm using terragrunt for implementing this module and I have a use case on creating a custom url_map resource with multiple host_rules and path_matchers. I'm getting a circular dependency error because to create the url map I need the backend service from this module, but to create the LB with a custom url_map I need the custom url_map already created.

So, implementing the custom url_map inside a module here would be great.

Terraform Resources

resource "google_compute_url_map" "default"

Detailed design

I did a quick and dirty proof of concept: https://github.com/eitchugo/terraform-google-lb-http/commit/0ad4b3d7e9480a3a3febfab66e3c7b640c699541

It's working, but not complete.

I want your opinion if it's OK to create a Pull Request and work on this. What I have on my mind:

Additional information

Related issue: https://github.com/terraform-google-modules/terraform-google-lb-http/issues/245

josh-d2 commented 3 months ago

+1, we're also experiencing this. Please fix!

vcolombo commented 2 months ago

I appear to be having a related issue. When trying to change the load_balancing_scheme of an existing load balancer created via this module from EXTERNAL to EXTERNAL_MANAGED, I receive the following error:

Error: Error when reading or editing BackendService: googleapi: Error 400: The backend_service resource 'projects/xxxxx/global/backendServices/xxxxx' is already being used by 'projects/xxxxx/global/urlMaps/xxxxx', resourceInUseByAnotherResource

github-actions[bot] commented 1 day ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days