Skip to content

Commit

Permalink
suppress case for private_dns_zone_id
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfrahry committed Oct 23, 2023
1 parent 9d1e23d commit 2de32bc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/postgres/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
"github.com/hashicorp/terraform-provider-azurerm/utils"
Expand Down Expand Up @@ -163,10 +164,11 @@ func resourcePostgresqlFlexibleServer() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
// todo make this case sensitive when https://github.com/Azure/azure-rest-api-specs/issues/26346 is fixed
DiffSuppressFunc: suppress.CaseDifference,
// This is `computed`, because there is a breaking change to require this field when setting vnet.
// For existing fs who don't want to be recreated, they could contact service team to manually migrate to the private dns zone
// We need to ignore the diff when remote is set private dns zone
ForceNew: true,
ValidateFunc: privatezones.ValidatePrivateDnsZoneID,
},

Expand Down Expand Up @@ -668,6 +670,10 @@ func resourcePostgresqlFlexibleServerUpdate(d *pluginsdk.ResourceData, meta inte
}
}

if d.HasChange("private_dns_zone_id") {
parameters.Properties.Network = expandArmServerNetwork(d)
}

var requireFailover bool
// failover is only supported when `zone` and `high_availability.0.standby_availability_zone` are exchanged with each other
if d.HasChanges("zone", "high_availability") {
Expand Down

0 comments on commit 2de32bc

Please sign in to comment.