diff --git a/azurerm/resource_arm_front_door.go b/azurerm/resource_arm_front_door.go index e20cb608ff1f..929ecdc92fd7 100644 --- a/azurerm/resource_arm_front_door.go +++ b/azurerm/resource_arm_front_door.go @@ -121,7 +121,7 @@ func resourceArmFrontDoor() *schema.Resource { }, "custom_host": { Type: schema.TypeString, - Required: true, + Optional: true, }, "custom_path": { Type: schema.TypeString, @@ -1018,6 +1018,9 @@ func expandArmFrontDoorRedirectConfiguration(input []interface{}) frontdoor.Redi // The way the API works is if you don't include the attribute in the structure // it is treated as Preserve instead of Replace... + if customHost != "" { + redirectConfiguration.CustomHost = utils.String(customHost) + } if customPath != "" { redirectConfiguration.CustomPath = utils.String(customPath) } @@ -1352,10 +1355,6 @@ func flattenArmFrontDoorRoutingRule(input *[]frontdoor.RoutingRule) []interface{ c["cache_use_dynamic_compression"] = true } } - } else { - // Set Defaults - c["cache_query_parameter_strip_directive"] = string(frontdoor.StripNone) - c["cache_use_dynamic_compression"] = false } rc = append(rc, c) diff --git a/website/docs/r/front_door.html.markdown b/website/docs/r/front_door.html.markdown index e97ebd738154..41005ec05721 100644 --- a/website/docs/r/front_door.html.markdown +++ b/website/docs/r/front_door.html.markdown @@ -134,7 +134,7 @@ The `frontend_endpoint` block supports the following: * `session_affinity_ttl_seconds` - (Optional) The TTL to use in seconds for session affinity, if applicable. Defaults to `0`. -* `enable_custom_https_provisioning` - (Required) Name of the Frontend Endpoint. +* `custom_https_provisioning_enabled` - (Required) Name of the Frontend Endpoint. * `web_application_firewall_policy_link_id` - (Optional) Defines the Web Application Firewall policy `ID` for each host. @@ -178,6 +178,8 @@ The `routing_rule` block supports the following: * `forwarding_configuration` - (Optional) A `forwarding_configuration` block as defined below. +* `redirect_configuration` - (Optional) A `redirect_configuration` block as defined below. + --- The `forwarding_configuration` block supports the following: @@ -194,6 +196,22 @@ The `forwarding_configuration` block supports the following: --- +The `redirect_configuration` block supports the following: + +* `custom_host` - (Optional) Set this to change the URL for the redirection. + +* `redirect_protocol` - (Optional) Protocol to use when redirecting. Valid options are `HTTPOnly`, `HTTPSOnly`, `MatchRequest`. Defaults to `MatchRequest` + +* `redirect_type` - (Optional) Status code for the redirect. Valida options are `Moved`, `Found`, `TemporaryRedirect`, `PermanentRedirect`. Defaults to `Found` + +* `custom_fragment` - (Optional) The destination fragment in the portion of URL after '#'. Set this to add a fragment to the redirect URL. + +* `custom_path` - (Optional) The path to retain as per the incoming request, or update in the URL for the redirection. + +* `custom_query_string` - (Optional) Replace any existing query string from the incoming request URL. + +--- + The `custom_https_configuration` block supports the following: * `certificate_source` - (Optional) Certificate source to encrypted `HTTPS` traffic with. Allowed values are `FrontDoor` or `AzureKeyVault`. Defaults to `FrontDoor`.