-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 route_configuration_override_action cdn_frontdoor_origin_group_id parameter should not be required #18889
Comments
@jluenne, thank you for opening this issue... this is a bit more difficult than I anticipated it would be to implement due to the rules which are enforced by the ARM API. resource "azurerm_cdn_frontdoor_rule" "MakeSureApisHaveShortCacheTime" {
depends_on = [azurerm_cdn_frontdoor_origin_group.web, azurerm_cdn_frontdoor_origin.web]
name = "MakeSureApisHaveShortCacheTime"
cdn_frontdoor_rule_set_id = azurerm_cdn_frontdoor_rule_set.web.id
order = 0
behavior_on_match = "Continue"
conditions {
url_path_condition {
operator = "RegEx"
negate_condition = false
match_values = ["api/?(.*)"]
transforms = ["Lowercase", "Trim"]
}
}
actions {
route_configuration_override_action {
query_string_caching_behavior = "UseQueryString"
compression_enabled = true
cache_behavior = "OverrideAlways"
cache_duration = "00:00:10"
}
}
} Changed fields by Portal:
Also of note, the Portal changes the UI depending on what you pick for the Yes:No:Other Considerations:Since this resource has already been released I need to be very careful to not introduce any breaking changes to the resource while also attempting to implement parity with the Portal, which is not easy. I will do my best to get this update into the |
NOTE: An unfortunate side effect to this fix, while technically this is not a breaking change because the |
@WodansSon How to disable cache through terraform when configuring route_configuration_override_action in azurerm_cdn_frontdoor_rule resource. I don't see any parameter for that and cache_duration argument is being shown as Required. When caching is disabled for the action we don't have to specify duration right? |
@sudeep1607, good question... there currently isn't a way to do this in Terraform as it is currently implemented. I will have to expose a new value in the |
@sudeep1607, I have added a fix to the PR which was opened to fix the original issue mentioned in this issue and to also fix the issue that you mentioned above. Once the fix is merged you will be able to match the portal behavior in Terraform by adding the below Without Overriding the Origin Group: actions {
route_configuration_override_action {
cache_behavior = "Disabled"
}
} Overriding the Origin Group: actions {
route_configuration_override_action {
cdn_frontdoor_origin_group_id = azurerm_cdn_frontdoor_origin_group.example.id
forwarding_protocol = "HttpsOnly"
cache_behavior = "Disabled"
}
} NOTE: @sudeep1607, I have opened tracking issue #19008 for this issue since it is really a different issue that was reported in a related issue. 🚀 |
* Initial check-in... * remove unnecessary conversion * add test cases * remove CustomizeDiff * add disable cache functionality * update test names * add disable cache update test * Add more test cases * add test case for optional update * address PR comments * update note in documentation * update documentation * doc update * update code comments and tests
This functionality has been released in v3.29.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! |
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. |
Is there an existing issue for this?
Community Note
Description
The parameter
cdn_frontdoor_origin_group_id
is required when specifying aroute_configuration_override_action
within anazurerm_cdn_frontdoor_rule
resource.(see https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_rule#cdn_frontdoor_origin_group_id)
In Azure Portal, it is possible to set "Override origin group" to "No", leaving the original routing untouched while other changes are still possible. This cannot be configured using terraform as long as
cdn_frontdoor_origin_group_id
is a required parameter.Actual use case:
The same rule set should be used for several routes with different origin groups. Caching behavior should be changed based on url_path_condition, but routing itself should not be changed.
Please allow the parameter
cdn_frontdoor_origin_group_id
to be optional to cover this use case.New or Affected Resource(s)/Data Source(s)
azurerm_cdn_frontdoor_rule
Potential Terraform Configuration
References
No response
The text was updated successfully, but these errors were encountered: