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 cache_duration of "00:00:00". #23376

Closed
1 task done
ingara opened this issue Sep 25, 2023 · 2 comments · Fixed by #23384
Closed
1 task done

azurerm_cdn_frontdoor_rule does not allow cache_duration of "00:00:00". #23376

ingara opened this issue Sep 25, 2023 · 2 comments · Fixed by #23384

Comments

@ingara
Copy link

ingara commented Sep 25, 2023

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.3.7

AzureRM Provider Version

3.40.0

Affected Resource(s)/Data Source(s)

azurerm_cdn_frontdoor_rule

Terraform Configuration Files

resource "azurerm_cdn_frontdoor_rule" "example" {
  cdn_frontdoor_rule_set_id = "/subscriptions/..."
  name                      = "disableDefaultCaching"
  order                     = 0

  actions {
    route_configuration_override_action {
      cdn_frontdoor_origin_group_id = "/subscriptions/..."
      cache_behavior                = "OverrideIfOriginMissing"
      cache_duration                = "00:00:00"
    }
  }
}

Debug Output/Panic Output

Error: "actions.0.route_configuration_override_action.0.cache_duration" must be longer than zero seconds, got "00:00:00"

Expected Behaviour

It should successfully create the rule with duration set to 0 seconds.

This is possible in the Azure Portal, and is according to Microsoft the only way to "disable" the default caching behaviour for responses which do not have cache headers.

Relevant portion of the docs (https://learn.microsoft.com/en-us/azure/frontdoor/front-door-rules-engine-actions?tabs=portal&pivots=front-door-standard-premium#properties – under "Cache duration"):

For a value of 0 seconds, the CDN caches the content, but must revalidate each request with the origin server.

The relevant code is at

if v == "00:00:00" {
return nil, []error{fmt.Errorf(`%q must be longer than zero seconds, got %q`, k, v)}
}

As far as I can tell this explicit check should be removed.

Actual Behaviour

Validation error.

Steps to Reproduce

  1. terraform validate

Important Factoids

No response

References

@rcskosir
Copy link
Contributor

@ingara Thank you for taking the time to open this issue. Please subscribe to PR #23384 created by @WodansSon for this issue.

WodansSon added a commit that referenced this issue Sep 28, 2023
* Initial Check-in...

* Fix error message grammar...

* Fix the same error message again...

* Initial Check-in...
@github-actions github-actions bot added this to the v3.75.0 milestone Sep 28, 2023
Copy link

github-actions bot commented May 6, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants