-
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_frontdoor
- expose support for cache_duration
and cache_query_parameters
fields
#12831
azurerm_frontdoor
- expose support for cache_duration
and cache_query_parameters
fields
#12831
Conversation
…/heoelri/terraform-provider-azurerm into feature/extend-frontdoor-caching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heoelri, thank you so much for this PR. I have left one minor comment requesting the addition of validation checks in the frontDoorCustomizeDiff
, but other than that this LGTM! 🚀
I was able to solve the issues with the acctests mentioned in my first comment in this PR. All
|
[pull] master from terraform-providers:master
[pull] master from terraform-providers:master
# Conflicts: # azurerm/internal/services/frontdoor/client/client.go # azurerm/internal/services/frontdoor/customizediff.go # azurerm/internal/services/frontdoor/frontdoor_custom_https_configuration.go # azurerm/internal/services/frontdoor/frontdoor_custom_https_configuration_resource.go # azurerm/internal/services/frontdoor/frontdoor_firewall_policy_resource.go # azurerm/internal/services/frontdoor/frontdoor_resource.go # azurerm/internal/services/frontdoor/frontdoor_resource_test.go # azurerm/internal/services/frontdoor/helper.go
[pull] main from terraform-providers:main
[pull] main from hashicorp:main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heoelri, thanks for pushing those changes. This LGTM! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aside from one comment LGTM
* `cache_query_parameter_strip_directive` - (Optional) Defines cache behaviour in relation to query string parameters. Valid options are `StripAll` or `StripNone`. Defaults to `StripAll`. | ||
* `cache_query_parameter_strip_directive` - (Optional) Defines cache behaviour in relation to query string parameters. Valid options are `StripAll`, `StripAllExcept`, `StripOnly` or `StripNone`. Defaults to `StripAll`. | ||
|
||
* `cache_query_parameters` - (Optional) Specify query parameters (comma separated). Works only in combination with `cache_query_parameter_strip_directive` set to `StripAllExcept` or `StripOnly`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be an array of values rather then a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katbyte thank you, that's a good idea. In Front Door's models.go
has QueryParameters
the type *string
that's why i've started as a string. But i agree that it's a much better idea to use an array here. I've made some changes to make query_parameters
an array now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(hit wrong button)
Making the `query_parameters` parameter an array
update feature/extend-frontdoor-caching branch from main
@heoelri, thanks for pushing those changes. We have one test failure, if you can get that fixed up we can get this merged! 🚀
|
Thank you very much for your help @WodansSon. The test was still looking for a string in ==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/frontdoor -run=TestAccFrontDoor_EnableDisableCache -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN TestAccFrontDoor_EnableDisableCache
=== PAUSE TestAccFrontDoor_EnableDisableCache
=== CONT TestAccFrontDoor_EnableDisableCache
--- PASS: TestAccFrontDoor_EnableDisableCache (489.44s) |
cache_duration
and cache_query_parameters
azurerm_frontdoor
- expose support for cache_duration
and cache_query_parameters
fields
@heoelri, thanks for pushing those changes again! LGTM and all the tests pass now! 🚀 |
This functionality has been released in v2.73.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 pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR extends the
azurerm_frontdoor
resource with some additional caching capabilities.cache_query_parameters
(new) is a comma-separated list of query parameterscache_duration
(new) contains the caching duration (iso 8601)cache_query_parameter_strip_directive
can now also be set toStripAllExcept
The Azure Front Door API version was updated from
2020-01-01
to2020-05-01
to support the newly added capabilities.github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/frontdoor/validate
is now imported asazValidate
(aligned with other resources like servicebus) to avoid conflicts withgithub.aaakk.us.kg/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate
(needed for some ISO8601 validation).The two new
parameters
have been added to the documentation andlocation
was dropped from the example and the details do now contain the information that this parameter has been deprecated.This is my first "code" PR and i've some issues with the tests.
make acctests
fails:The module itself works like a charm:
It would be great if someone can take a look and help me to get this through.