hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.74k forks source link

Make strip_query in google_compute_url_map optional #7742

Open Chupaka opened 4 years ago

Chupaka commented 4 years ago

Community Note

Description

There are three places in docs where strip_query is described as "This field is required to ensure an empty block is not set." But as I can see, there is a better approach used, for example, in http_health_check: "at_least_one_of" https://github.com/GoogleCloudPlatform/magic-modules/blob/837e4128c650791b228b0adb7c86cd6683a50b03/products/compute/api.yaml#L4224

So google_compute_url_map can be refactored to remove that "dirty hack" with required field.

New or Affected Resource(s)

b/374162367

ggtisc commented 2 months ago

Hi @Chupaka!

There is this optional strip_query and these other 3 mandatory strip_query resources:

  1. url_redirect
  2. default_url_redirect
  3. 2nd default_url_redirect

As you can see in terraform registry each one has different purposes according to user needs

Chupaka commented 2 months ago

@ggtisc aren't all your links the same?..

Anyway, what I was talking about is that "strip_query" should not be mandatory just "to ensure an empty block is not set". E.g., if I set https_redirect, I don't want to set also strip_query, because my url_redirect block is not empty already, but I still have to add that silly strip_query.