terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

`azurerm_application_gateway`: Support for `components` in `rewrite_rule_set.rewrite_rule.url`

Open aristosvo opened this issue 3 years ago • 6 comments

Fixes #13894 Fixes #11563

Introduction of a rewrite_rule_set.rewrite_rule.url.components property to limit rewrite to URL Path or URL Query String only

Acceptance Tests

❯ go install && make acctests SERVICE='network' TESTARGS='-run=TestAccApplicationGateway_rewriteRuleSets_rewriteUrl'
==> 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/network -run=TestAccApplicationGateway_rewriteRuleSets_rewriteUrl -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccApplicationGateway_rewriteRuleSets_rewriteUrl
=== PAUSE TestAccApplicationGateway_rewriteRuleSets_rewriteUrl
=== CONT  TestAccApplicationGateway_rewriteRuleSets_rewriteUrl
--- PASS: TestAccApplicationGateway_rewriteRuleSets_rewriteUrl (712.80s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/network     714.417

aristosvo avatar Oct 26 '21 10:10 aristosvo

I'm not sure this is any better a solution that the existing work-around of using the query string parameter. I think this just makes usage more complicated.

I did do a bit more digging into this problem recently and it looks like the terraform SDK allows you to use the ResourceData.GetOk() method to check if the value has been set at all, but at the moment I don't see how to access this deeply nested data type using that method.

This would be the ideal way to check if the value has been set at all rather than using the != nil checks.

dhensby avatar Oct 26 '21 14:10 dhensby

I'm not sure either. If the existing work-around is good enough we should at least document it. #14221 validates my way of thinking, but I'd agree with the existing solution as long as it's correctly documented and containing a solution for both replacement of only query_string or only path.

With regard to ResourceData.GetOk(), in my experience this doesn't solve the issue here unfortunately..

aristosvo avatar Oct 26 '21 15:10 aristosvo

@tombuildsstuff, looks like the changes made caused a test to fail

TestAccApplicationGateway_rewriteRuleSets_rewriteUrl
testcase.go:110: Step 1/2 error: Check failed: Check 4/7 error: azurerm_application_gateway.test: Attribute 'rewrite_rule_set.0.rewrite_rule.0.url.0.components' expected "", got "path_only"

mbfrahry avatar Mar 21 '22 19:03 mbfrahry

When this PR will be released ? 3 weeks that the feature is ready...

benj-ch avatar Apr 15 '22 06:04 benj-ch

This functionality has been released in v3.4.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 surprised that the feature isn't in the v3.4.0 of Terraform Provider as stated... Do you have any release information?

benj-ch avatar Apr 29 '22 06:04 benj-ch

This functionality has been released in v3.19.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!

github-actions[bot] avatar Aug 23 '22 15:08 github-actions[bot]

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. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Sep 23 '22 02:09 github-actions[bot]