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_postgresql_flexible_server - private_dns_zone_id is no longer ForceNew and case is suppressed #23660

Merged
merged 1 commit into from
Oct 25, 2023
Merged
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
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
Loading