From 1dd239457dfb2a059493fe7a168bf1e2b710af72 Mon Sep 17 00:00:00 2001 From: "Till Markus (INST-CSS/BSV-OS)" Date: Wed, 27 Mar 2019 21:41:29 +0100 Subject: [PATCH] make zone redundency default vaule api driven --- azurerm/resource_arm_mssql_elasticpool.go | 8 +++++--- azurerm/resource_arm_mssql_elasticpool_test.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/azurerm/resource_arm_mssql_elasticpool.go b/azurerm/resource_arm_mssql_elasticpool.go index 88679557d613..f1c4a2c785fc 100644 --- a/azurerm/resource_arm_mssql_elasticpool.go +++ b/azurerm/resource_arm_mssql_elasticpool.go @@ -177,7 +177,6 @@ func resourceArmMsSqlElasticPool() *schema.Resource { "zone_redundant": { Type: schema.TypeBool, Optional: true, - Default: false, }, "tags": tagsSchema(), @@ -203,7 +202,6 @@ func resourceArmMsSqlElasticPoolCreateUpdate(d *schema.ResourceData, meta interf elasticPoolName := d.Get("name").(string) serverName := d.Get("server_name").(string) resGroup := d.Get("resource_group_name").(string) - zoneredundant := d.Get("zone_redundant").(bool) if requireResourcesToBeImported && d.IsNewResource() { existing, err := client.Get(ctx, resGroup, serverName, elasticPoolName) @@ -229,10 +227,14 @@ func resourceArmMsSqlElasticPoolCreateUpdate(d *schema.ResourceData, meta interf Tags: expandTags(tags), ElasticPoolProperties: &sql.ElasticPoolProperties{ PerDatabaseSettings: expandAzureRmMsSqlElasticPoolPerDatabaseSettings(d), - ZoneRedundant: &zoneredundant, }, } + if v, ok := d.GetOkExists("zone_redundant"); ok { + zoneRedundant := v.(bool) + elasticPool.ElasticPoolProperties.ZoneRedundant = &zoneRedundant + } + if d.HasChange("max_size_gb") { if v, ok := d.GetOk("max_size_gb"); ok { maxSizeBytes := v.(float64) * 1073741824 diff --git a/azurerm/resource_arm_mssql_elasticpool_test.go b/azurerm/resource_arm_mssql_elasticpool_test.go index 82dc77ef650d..8b352b126e95 100644 --- a/azurerm/resource_arm_mssql_elasticpool_test.go +++ b/azurerm/resource_arm_mssql_elasticpool_test.go @@ -507,7 +507,7 @@ resource "azurerm_mssql_elasticpool" "test" { location = "${azurerm_resource_group.test.location}" server_name = "${azurerm_sql_server.test.name}" max_size_gb = %.7[6]f - zone_redundant = %[9]t + zone_redundant = %[9]t sku { name = "%[3]s"