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 - support for redirect rules #2908

Merged
merged 26 commits into from
Mar 21, 2019

Conversation

RustyF
Copy link
Contributor

@RustyF RustyF commented Feb 18, 2019

WIP. I still need to write the tests and update the docs but I'm creating this PR now so you guys can take an early look.

I'm a go newbie and now using GoLand after grief with VSCode. My formatting is screwed also :)

@ghost ghost added the size/L label Feb 18, 2019
@ghost ghost added the documentation label Feb 18, 2019
@ghost ghost added size/XL and removed size/L labels Feb 18, 2019
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 @RustyF,

Had a quick glance and left a couple minor comments inline, but overall this is looking pretty good 🙂 let us know when it's ready for a proper review

azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Show resolved Hide resolved
@RustyF
Copy link
Contributor Author

RustyF commented Feb 21, 2019

Thanks @katbyte for that initial review and categorisation. Of course, I will make the suggested changes.

One question on semantic validation, there are more mutually exclusive settings now. Do you typically leave these to be checked by Azure or would you like me to try and add some validation in the code? E.g. you can't have a target listener and a target URL.

@katbyte
Copy link
Collaborator

katbyte commented Feb 22, 2019

@RustyF,

Usually we try to do as mch validation at the schema level so errors are caught during plan, or at the very least before trying the API as frequently the errors returned by azure are mysterious and unhelpful. But it's not always viable or required.

If you can add a check to flattenApplicationGatewayRedirectConfigurations() so an understandable error is floated up to the user that would suffice 🙂

Remove conflicts (not usable for nested resources)
Add validation in expansion funcs
…e (with target listener and target URL mix)

(not run yet - local environment issues)
@RustyF
Copy link
Contributor Author

RustyF commented Feb 28, 2019

Quick update, I've made all the suggested changes, added some validation. I've also added a couple of tests which should give it reasonable coverage. I haven't actually run the tests yet 😮 as I'm having unrelated make test problems but will try again tomorrow. Other than that, subject to obvious issues or things I've overlooked/not understood, it should be code-complete/stable.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @RustyF

Thanks for pushing those changes - I've taken a look through and this is looking really good, if we can fix up the minor issues (which I've commented in-line) then we should be able to run the tests and get this merged 👍

Thanks!

azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
website/docs/r/application_gateway.html.markdown Outdated Show resolved Hide resolved
website/docs/r/application_gateway.html.markdown Outdated Show resolved Hide resolved
@tombuildsstuff tombuildsstuff changed the title Redirect configuration azurerm_application_gateway - support for redirect rules Feb 28, 2019
…rgetURL is fully specified. Not sure yet what to do with mutually-exclusive SubResource * references.
@ghost ghost removed the waiting-response label Mar 4, 2019
@RustyF
Copy link
Contributor Author

RustyF commented Mar 5, 2019

Update, the first acceptance test works, i.e. basic rule with re-direction to HTTP listener. It just takes a while to run and obviously timed out yesterday. I'm still diagnosing the path map redirection test.

…f specified

Ensure that default HTTP settings and back-end pool settings are now optional on path URL map (to facilitate redirections)
Tweak tests to reflect better understanding of path URL map
@RustyF
Copy link
Contributor Author

RustyF commented Mar 6, 2019

Ran out of time today but think I've resolved the problems with path URL map-based redirects. Will run the acceptance tests tomorrow and confirm.

@RustyF
Copy link
Contributor Author

RustyF commented Mar 6, 2019

Acceptance tests are passing so we are pretty much there now, I think 😉. I'm going to review the docs again as I haven't looked at them since the final tweaks.

@RustyF
Copy link
Contributor Author

RustyF commented Mar 6, 2019

Please take a final look at the code. As a go newbie, I won't be doing idiomatic things yet.

…viously required properties are now optional.
@RustyF
Copy link
Contributor Author

RustyF commented Mar 6, 2019

Doc updates done.

@RustyF
Copy link
Contributor Author

RustyF commented Mar 9, 2019

Let me know if you need me to do anything?

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 for the updates @RustyF,

Aside from a couple comments i've left inline this is looking good. My primary comment is i don't think you need the NilOrEmpty function, I think that code should just be inlined.

azurerm/helpers/validate/strings.go Outdated Show resolved Hide resolved
azurerm/resource_arm_application_gateway.go Outdated Show resolved Hide resolved
@RustyF
Copy link
Contributor Author

RustyF commented Mar 17, 2019

I ran the acceptance tests again successfully.

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.

left comment on wrong pr

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 for the updates @RustyF! this LGTM now 👍

@katbyte katbyte added this to the v1.24.0 milestone Mar 21, 2019
@katbyte katbyte merged commit 0846e21 into hashicorp:master Mar 21, 2019
katbyte added a commit that referenced this pull request Mar 21, 2019
@RustyF
Copy link
Contributor Author

RustyF commented Mar 22, 2019

@katbyte , @tombuildsstuff thanks for your support and patience on this 👍

@ghost
Copy link

ghost commented Apr 3, 2019

This has been released in version 1.24.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 = "~> 1.24.0"
}
# ... other configuration ...

@OffColour
Copy link

@RustyF Massive thanks for your work on this. Started using it yesterday and works perfectly!

@RustyF
Copy link
Contributor Author

RustyF commented Apr 8, 2019

Thanks for the feedback - good to know

@ghost
Copy link

ghost commented Apr 21, 2019

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 21, 2019
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.

4 participants