From 07327d9b83d28dd09c53cadf8cd2a641fb8e54df Mon Sep 17 00:00:00 2001 From: mcharriere Date: Sun, 28 Apr 2019 22:18:56 -0300 Subject: [PATCH] Application Gateway: removed validation in application gateway (#3286) Fixes #3285 --- azurerm/resource_arm_application_gateway.go | 7 ------- azurerm/resource_arm_application_gateway_test.go | 5 +++-- website/docs/r/application_gateway.html.markdown | 8 +++++--- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/azurerm/resource_arm_application_gateway.go b/azurerm/resource_arm_application_gateway.go index 983004d17029..58c7966848a7 100644 --- a/azurerm/resource_arm_application_gateway.go +++ b/azurerm/resource_arm_application_gateway.go @@ -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)") } diff --git a/azurerm/resource_arm_application_gateway_test.go b/azurerm/resource_arm_application_gateway_test.go index d82314cb2cb1..31079575000b 100644 --- a/azurerm/resource_arm_application_gateway_test.go +++ b/azurerm/resource_arm_application_gateway_test.go @@ -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" { @@ -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}" diff --git a/website/docs/r/application_gateway.html.markdown b/website/docs/r/application_gateway.html.markdown index 8984ac29072d..c90463dc6147 100644 --- a/website/docs/r/application_gateway.html.markdown +++ b/website/docs/r/application_gateway.html.markdown @@ -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. @@ -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: