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_frontdoor update custom_host to be optional, add redirect_configuration to documentation #4601

Merged
merged 2 commits into from
Oct 11, 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
9 changes: 4 additions & 5 deletions azurerm/resource_arm_front_door.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func resourceArmFrontDoor() *schema.Resource {
},
"custom_host": {
Type: schema.TypeString,
Required: true,
Optional: true,
},
"custom_path": {
Type: schema.TypeString,
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 19 additions & 1 deletion website/docs/r/front_door.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand All @@ -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`.
Expand Down