Skip to content

Commit

Permalink
make zone redundency default vaule api driven
Browse files Browse the repository at this point in the history
  • Loading branch information
bs-matil committed Mar 27, 2019
1 parent b434b8a commit 1dd2394
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions azurerm/resource_arm_mssql_elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func resourceArmMsSqlElasticPool() *schema.Resource {
"zone_redundant": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},

"tags": tagsSchema(),
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_mssql_elasticpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1dd2394

Please sign in to comment.