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

Application Gateway: removed validation in application gateway #3286

Merged
merged 3 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions azurerm/resource_arm_application_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -2540,18 +2540,11 @@ func flattenApplicationGatewayURLPathMaps(input *[]network.ApplicationGatewayURL
}

if ruleProps := rule.ApplicationGatewayPathRulePropertiesFormat; ruleProps != nil {
if applicationGatewayHasSubResource(props.DefaultBackendAddressPool) && applicationGatewayHasSubResource(ruleProps.RedirectConfiguration) {
return nil, fmt.Errorf("[ERROR] Conflict between `default_backend_address_pool_name` and `redirect_configuration_name` (default back-end pool not applicable when redirection specified)")
}

if applicationGatewayHasSubResource(ruleProps.BackendAddressPool) && applicationGatewayHasSubResource(ruleProps.RedirectConfiguration) {
return nil, fmt.Errorf("[ERROR] Conflict between `backend_address_pool_name` and `redirect_configuration_name` (back-end pool not applicable when redirection specified)")
}

if applicationGatewayHasSubResource(props.DefaultBackendHTTPSettings) && applicationGatewayHasSubResource(ruleProps.RedirectConfiguration) {
return nil, fmt.Errorf("[ERROR] Conflict between `default_backend_http_settings_name` and `redirect_configuration_name` (default back-end settings not applicable when redirection specified)")
}

if applicationGatewayHasSubResource(ruleProps.BackendHTTPSettings) && applicationGatewayHasSubResource(ruleProps.RedirectConfiguration) {
return nil, fmt.Errorf("[ERROR] Conflict between `backend_http_settings_name` and `redirect_configuration_name` (back-end settings not applicable when redirection specified)")
}
Expand Down
5 changes: 3 additions & 2 deletions azurerm/resource_arm_application_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ locals {
url_path_map_name = "${azurerm_virtual_network.test.name}-urlpath1"
redirect_configuration_name = "${azurerm_virtual_network.test.name}-PathRedirect"
redirect_configuration_name2 = "${azurerm_virtual_network.test.name}-PathRedirect2"
target_url = "http://www.example.com"
target_url = "http://www.example.com"
}

resource "azurerm_application_gateway" "test" {
Expand Down Expand Up @@ -1383,7 +1383,8 @@ resource "azurerm_application_gateway" "test" {

url_path_map {
name = "${local.url_path_map_name}"
default_redirect_configuration_name = "${local.redirect_configuration_name}"
default_backend_address_pool_name = "${local.backend_address_pool_name}"
default_backend_http_settings_name = "${local.http_setting_name}"

path_rule {
name = "${local.path_rule_name}"
Expand Down
8 changes: 5 additions & 3 deletions website/docs/r/application_gateway.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,12 @@ A `url_path_map` block supports the following:

* `name` - (Required) The Name of the URL Path Map.

* `default_backend_address_pool_name` - (Optional) The Name of the Default Backend Address Pool which should be used for this URL Path Map. Cannot be set if there are path_rules with re-direct configurations set.
* `default_backend_address_pool_name` - (Optional) The Name of the Default Backend Address Pool which should be used for this URL Path Map. Cannot be set if `default_redirect_configuration_name` is set.

* `default_backend_http_settings_name` - (Optional) The Name of the Default Backend HTTP Settings Collection which should be used for this URL Path Map. Cannot be set if there are path_rules with re-direct configurations set.
* `default_backend_http_settings_name` - (Optional) The Name of the Default Backend HTTP Settings Collection which should be used for this URL Path Map. Cannot be set if `default_redirect_configuration_name` is set.

* `default_redirect_configuration_name` - (Optional) The Name of the Default Redirect Configuration which should be used for this URL Path Map. Cannot be set if either `default_backend_address_pool_name` or `default_backend_http_settings_name` is set.

* `default_redirect_configuration_name` - (Optional) The Name of the Default Redirect Configuration which should be used for this URL Path Map. Cannot be set if there are path_rules with Backend Address Pool or HTTP Settings set.

* `path_rule` - (Required) One or more `path_rule` blocks as defined above.

Expand Down Expand Up @@ -453,6 +454,7 @@ The following attributes are exported:
* `custom_error_configuration` - A list of `custom_error_configuration` blocks as defined below.

* `redirect_configuration` - A list of `redirect_configuration` blocks as defined below.

---

A `authentication_certificate` block exports the following:
Expand Down