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_application_gateway: can combine include_path with target_url #6175

Merged

Conversation

bailsman
Copy link
Contributor

Redirecting say http://foo/path?query to http://bar/
include_path controls whether it will go to
http://bar/path
or
http://bar/

This is a perfectly valid option in a redirect_configuration in
combination with target_url. Currently the code gives an error if you
use them in combination and omits it from the request if target_url is
set.

Omitting include_path has strange results in the Azure Portal
(no radio button selected) and "null" defaults to true whereas the
documentation says include_path should default to false.

This change makes the behavior consistent with the documentation.

Redirecting say http://foo/path?query to http://bar/
include_path controls whether it will go to
	http://bar/path
or
	http://bar/

This is a perfectly valid option in a redirect_configuration in
combination with target_url. Currently the code gives an error if you
use them in combination and omits it from the request if target_url is
set.

Omitting include_path has strange results in the Azure Portal
(no radio button selected) and "null" defaults to true whereas the
documentation says include_path should default to false.

This change makes the behavior consistent with the documentation.
@ghost ghost added the size/XS label Mar 19, 2020
@bailsman
Copy link
Contributor Author

I've only tested this with a 302 Found redirect using target_url in a redirect_configuration. I don't fully understand the purpose behind this check that include_path should not be used in combination with target_url.

Did the API change since this resource was first designed, or does this change break something in some other usage of redirect_configuration?

Hopefully someone more familiar with this code and the Application Gateway can advise.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bailsman,

my money would be on the API changed, but i can't say for sure. However could you add a test where we set both target URL and include path so we can verify it works & ensure if the API changes again in the future we notice? thanks!

@ghost ghost added size/L and removed size/XS labels Mar 30, 2020
@mbfrahry
Copy link
Member

Added a test!

--- PASS: TestAccAzureRMApplicationGateway_IncludePathWithTargetURL (1752.21s)

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mbfrahry! LGTM now

@katbyte katbyte added this to the v2.4.0 milestone Apr 2, 2020
@katbyte katbyte merged commit 69cdfbf into hashicorp:master Apr 2, 2020
katbyte added a commit that referenced this pull request Apr 2, 2020
@ghost
Copy link

ghost commented Apr 2, 2020

This has been released in version 2.4.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.4.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented May 3, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants