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_front_door - Add minimum_tls_version property #5539

Merged
merged 10 commits into from
Jan 31, 2020
16 changes: 15 additions & 1 deletion azurerm/internal/services/frontdoor/resource_arm_front_door.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ func resourceArmFrontDoor() *schema.Resource {
}, false),
Default: string(frontdoor.CertificateSourceFrontDoor),
},
"minimum_tls_version": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
string(frontdoor.OneFullStopTwo),
string(frontdoor.OneFullStopZero),
}, false),
Default: string(frontdoor.OneFullStopZero), // TODO: Update default to TLS 1.2 in version 2.0
},
"provisioning_state": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -1265,6 +1274,8 @@ func flattenArmFrontDoorFrontendEndpoint(d *schema.ResourceData, input *[]frontd
chc["certificate_source"] = string(frontdoor.CertificateSourceFrontDoor)
}

chc["minimum_tls_version"] = string(customHTTPSConfiguration.MinimumTLSVersion)

if provisioningState := properties.CustomHTTPSProvisioningState; provisioningState != "" {
chc["provisioning_state"] = provisioningState
if provisioningState == frontdoor.CustomHTTPSProvisioningStateEnabled || provisioningState == frontdoor.CustomHTTPSProvisioningStateEnabling {
Expand Down Expand Up @@ -1502,8 +1513,11 @@ func makeCustomHttpsConfiguration(customHttpsConfiguration map[string]interface{
// https://github.com/Azure/azure-sdk-for-go/issues/6882
defaultProtocolType := "ServerNameIndication"

minTLSVersion := customHttpsConfiguration["minimum_tls_version"].(string)

customHTTPSConfigurationUpdate := frontdoor.CustomHTTPSConfiguration{
ProtocolType: &defaultProtocolType,
ProtocolType: &defaultProtocolType,
MinimumTLSVersion: frontdoor.MinimumTLSVersion(minTLSVersion),
}

if customHttpsConfiguration["certificate_source"].(string) == "AzureKeyVault" {
Expand Down
4 changes: 4 additions & 0 deletions website/docs/guides/2.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ The deprecated `location` field will be removed, since this is no longer used.

The deprecated `internal_public_ip_address_id` field in the `ip_configuration` block will be removed. This field has been replaced by the `public_ip_address_id` field in the `ip_configuration` block.

### Resource: `azurerm_frontdoor`

The default value of the `minimum_tls_version` field in the `custom_https_configuration` block will be changed from `1.0` to `1.2` to align with [updates to the Azure platform defaults](https://docs.microsoft.com/en-us/azure/frontdoor/front-door-faq#what-tls-versions-are-supported-by-azure-front-door-service)

### Resource: `azurerm_iothub`

The deprecated `sku.tier` property will be remove.
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/front_door.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ 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`.

* `minimum_tls_version` - (Optional) Minimum TLS version required for clients to connect. Allowed values are `1.0` or `1.2`. Defaults to `1.0`.

The following attributes are only valid if `certificate_source` is set to `AzureKeyVault`:

* `azure_key_vault_certificate_vault_id` - (Required) The ID of the Key Vault containing the SSL certificate.
Expand Down