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

azurerm_cdn_frontdoor_rule does not allow slash in match_values #26016

Closed
1 task done
luismy opened this issue May 18, 2024 · 1 comment · Fixed by #26017
Closed
1 task done

azurerm_cdn_frontdoor_rule does not allow slash in match_values #26016

luismy opened this issue May 18, 2024 · 1 comment · Fixed by #26017

Comments

@luismy
Copy link
Contributor

luismy commented May 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

Terraform Version

1.5.7

AzureRM Provider Version

3.104.0

Affected Resource(s)/Data Source(s)

azurerm_cdn_frontdoor_rule

Terraform Configuration Files

resource "azurerm_cdn_frontdoor_rule" "index" {
  name                      = "index"
  cdn_frontdoor_rule_set_id = azurerm_cdn_frontdoor_rule_set.index.id
  order                     = 1

  actions {
    url_rewrite_action {
      destination    = "/index.html"
      source_pattern = "/"
    }
  }

  conditions {
    url_path_condition {
      match_values = ["/legacy-login"]
      operator     = "Equal"
    }
  }
  depends_on = [azurerm_cdn_frontdoor_origin.frontend, azurerm_cdn_frontdoor_origin_group.frontend]
}

Debug Output/Panic Output

N/A

Expected Behaviour

It should be supported.

I found #21851, which fixes the issue when using just /. I believe the fix would be to remove this conditional block https://github.com/hashicorp/terraform-provider-azurerm/pull/22610/files#diff-e2d4895b125eec64059034bf8652c9c54638785ec2d6c8555d25b80bb9652350R49

If I edit the rules using the Azure portal it allows the /legacy-login value. Running terraform plan will obviously see the change and try to roll it back, see output after the change done manually

      ~ conditions {
          ~ url_path_condition {
              ~ match_values     = [
                  - "/legacy-login",
                  + "legacy-login",
                ]
                # (3 unchanged attributes hidden)
            }
        }

Actual Behaviour

I get this error

│ Error: "conditions.0.url_path_condition.0.match_values.0" must not begin with the URLs leading slash(e.g. /), got "/legacy-login"
│ 
│   on test.tf line 16, in resource "azurerm_cdn_frontdoor_rule" "index":
│   16:       match_values = ["/legacy-login"]

Steps to Reproduce

terraform validate

Important Factoids

No response

References

Copy link

This functionality has been released in v3.105.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

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