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

net-ilb-l7 module bug has mismatch of urlconfig parameters. #1288

Closed
CodyKurtz opened this issue Mar 29, 2023 · 2 comments · Fixed by #1299
Closed

net-ilb-l7 module bug has mismatch of urlconfig parameters. #1288

CodyKurtz opened this issue Mar 29, 2023 · 2 comments · Fixed by #1299
Assignees

Comments

@CodyKurtz
Copy link

CodyKurtz commented Mar 29, 2023

When configuring a URL map with the urlmap_config parameter on the net-ilb-l7 module, the Terraform apply will fail when specifying a route_rule. There is no default_url_parameter under route_rules. The parameter is url_redirect and is reflected in the url map variables file.

See the following links to see the mismatch.

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/blob/v21.0.0/modules/net-ilb-l7/variables-urlmap.tf#L214

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/blob/v21.0.0/modules/net-ilb-l7/urlmap.tf#L548

The following error is produced:

 

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Unsupported attribute
│
│   on .urlmap.tf line 548, in resource "google_compute_region_url_map" "default":
│  548:               route_rules.value.default_url_redirect == null
│     ├────────────────
│     │ route_rules.value is object with 6 attributes
│
│ This object does not have an attribute named "default_url_redirect".

Urlmap.tf

Dynamic "url_redirect" {
            for_each = (
              route_rules.value.default_url_redirect == null
              ? []
              : [route_rules.value.default_url_redirect]

Variables-urlmap.tf


       url_redirect = optional(object({
          host          = optional(string)
          https         = optional(bool)
          path          = optional(string)
          prefix        = optional(string)
          response_code = optional(string)
          strip_query   = optional(bool)
        }))

@CodyKurtz CodyKurtz changed the title net-ilb-l7 module needs updating to reflect parameters. net-ilb-l7 module bug has mismatch of urlconfig parameters. Mar 29, 2023
@ludoo ludoo self-assigned this Apr 3, 2023
@ludoo
Copy link
Collaborator

ludoo commented Apr 3, 2023

@CodyKurtz would you mind sharing the module configuration so we can plug it into a test?

@ludoo
Copy link
Collaborator

ludoo commented Apr 3, 2023

Thanks a lot for flagging this and doing the investigation!

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

Successfully merging a pull request may close this issue.

2 participants