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

default_service wrongly required in google_compute_region_url_map in path_matcher bock #7951

Open
Gilles95 opened this issue Dec 7, 2020 · 4 comments
Assignees
Labels

Comments

@Gilles95
Copy link

Gilles95 commented Dec 7, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.13.4

Affected Resource(s)

  • google_compute_region_url_map

Terraform Configuration Files

resource "google_compute_region_url_map" "test-url-map" {
  name            = "test-url-map"

  host_rule {
    hosts                 = ["myfqdn.here.com"]
    path_matcher          = "patchername"
  }

  path_matcher {
    name                  = "patchername"
    default_url_redirect {
      host_redirect    = "redirect.here.com"
      https_redirect   = true
      strip_query      = false
    }
  }
}

Debug Output

main.tf in resource "google_compute_region_url_map" "test-url-map":
  95:   path_matcher {

The argument "default_service" is required, but no definition was found.

Panic Output

Expected Behavior

Terraform plan to succeed and not requesting a default_service to be set when a default_url_redirect is set within a path_matcher block. As per the google documentation:

pathMatchers[].defaultService
...
Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.

https://cloud.google.com/compute/docs/reference/rest/v1/regionUrlMaps

Actual Behavior

main.tf in resource "google_compute_region_url_map" "test-url-map":
  95:   path_matcher {

The argument "default_service" is required, but no definition was found.

Steps to Reproduce

resource "google_compute_region_url_map" "test-url-map" {
  name            = "test-url-map"

  host_rule {
    hosts                 = ["myfqdn.here.com"]
    path_matcher          = "patchername"
  }

  path_matcher {
    name                  = "patchername"
    default_url_redirect {
      host_redirect    = "redirect.here.com"
      https_redirect   = true
      strip_query      = false
    }
  }
}

  1. terraform plan

Important Factoids

References

  • #0000
@ghost ghost added the bug label Dec 7, 2020
@edwardmedia edwardmedia self-assigned this Dec 7, 2020
@edwardmedia
Copy link
Contributor

@Gilles95 do you notice the default_service field at the root? Let me know if that works

@Gilles95
Copy link
Author

Gilles95 commented Dec 7, 2020

@Gilles95 do you notice the default_service field at the root? Let me know if that works

@edwardmedia , thanks for following up. Yes I noticed it at the root, the root one is actually optional which is good, and we also have default_service within the path_matcher block, but that one is not optional and should be.
I am getting familiar with magic-module to PR it.

@ghost ghost removed waiting-response labels Dec 7, 2020
@edwardmedia
Copy link
Contributor

@Gilles95 have you tried to put default_service at the root?

@Gilles95
Copy link
Author

Gilles95 commented Dec 8, 2020

@edwardmedia, yes I did but the issue remains and the error point to the path_matcher line block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants