Skip to content

Commit

Permalink
azurerm_sql_managed_instance: Support for dns_zone_partner_id (#1…
Browse files Browse the repository at this point in the history
…3951)

Fixes #13932 (½)

This PR is the first step of 2 towards the failover capability as described in #13932. This first step makes it possible to share the DNS zone, to make failover possible. Documentation about failover for MI can be found here.
  • Loading branch information
aristosvo authored Nov 2, 2021
1 parent 67f3c11 commit 0afa7d3
Show file tree
Hide file tree
Showing 3 changed files with 1,265 additions and 7 deletions.
13 changes: 13 additions & 0 deletions internal/services/sql/sql_managed_instance_resource.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package sql

import (
"context"
"fmt"
"log"
"strings"
Expand Down Expand Up @@ -162,8 +163,19 @@ func resourceArmSqlMiServer() *schema.Resource {
Computed: true,
},

"dns_zone_partner_id": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: azure.ValidateResourceID,
},

"tags": tags.Schema(),
},

CustomizeDiff: pluginsdk.ForceNewIfChange("dns_zone_partner_id", func(ctx context.Context, old, new, _ interface{}) bool {
// dns_zone_partner_id can only be set on init
return old.(string) == "" && new.(string) != ""
}),
}
}

Expand Down Expand Up @@ -211,6 +223,7 @@ func resourceArmSqlMiServerCreateUpdate(d *schema.ResourceData, meta interface{}
MinimalTLSVersion: utils.String(d.Get("minimum_tls_version").(string)),
ProxyOverride: sql.ManagedInstanceProxyOverride(d.Get("proxy_override").(string)),
TimezoneID: utils.String(d.Get("timezone_id").(string)),
DNSZonePartner: utils.String(d.Get("dns_zone_partner_id").(string)),
},
}

Expand Down
Loading

0 comments on commit 0afa7d3

Please sign in to comment.