diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_elasticpool.go b/azurerm/internal/services/mssql/resource_arm_mssql_elasticpool.go index 23c8b521d3d3..ab4603acac80 100644 --- a/azurerm/internal/services/mssql/resource_arm_mssql_elasticpool.go +++ b/azurerm/internal/services/mssql/resource_arm_mssql_elasticpool.go @@ -129,45 +129,6 @@ func resourceArmMsSqlElasticPool() *schema.Resource { }, }, - "elastic_pool_properties": { - Type: schema.TypeList, - Computed: true, - Deprecated: "These properties herein have been moved to the top level or removed", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "state": { - Type: schema.TypeString, - Computed: true, - Deprecated: "This property has been removed", - }, - - "creation_date": { - Type: schema.TypeString, - Computed: true, - Deprecated: "This property has been removed", - }, - - "max_size_bytes": { - Type: schema.TypeInt, - Computed: true, - Deprecated: "This property has been moved to the top level", - }, - - "zone_redundant": { - Type: schema.TypeBool, - Computed: true, - Deprecated: "This property has been moved to the top level", - }, - - "license_type": { - Type: schema.TypeString, - Computed: true, - Deprecated: "This property has been removed", - }, - }, - }, - }, - "max_size_bytes": { Type: schema.TypeInt, Optional: true, @@ -320,11 +281,6 @@ func resourceArmMsSqlElasticPoolRead(d *schema.ResourceData, meta interface{}) e } d.Set("zone_redundant", properties.ZoneRedundant) - // todo remove in 2.0 - if err := d.Set("elastic_pool_properties", flattenAzureRmMsSqlElasticPoolProperties(resp.ElasticPoolProperties)); err != nil { - return fmt.Errorf("Error setting `elastic_pool_properties`: %+v", err) - } - if err := d.Set("per_database_settings", flattenAzureRmMsSqlElasticPoolPerDatabaseSettings(properties.PerDatabaseSettings)); err != nil { return fmt.Errorf("Error setting `per_database_settings`: %+v", err) } @@ -412,23 +368,6 @@ func flattenAzureRmMsSqlElasticPoolSku(input *sql.Sku) []interface{} { return []interface{}{values} } -func flattenAzureRmMsSqlElasticPoolProperties(resp *sql.ElasticPoolProperties) []interface{} { - elasticPoolProperty := map[string]interface{}{} - elasticPoolProperty["state"] = string(resp.State) - - if date := resp.CreationDate; date != nil { - elasticPoolProperty["creation_date"] = date.String() - } - - if zoneRedundant := resp.ZoneRedundant; zoneRedundant != nil { - elasticPoolProperty["zone_redundant"] = *zoneRedundant - } - - elasticPoolProperty["license_type"] = string(resp.LicenseType) - - return []interface{}{elasticPoolProperty} -} - func flattenAzureRmMsSqlElasticPoolPerDatabaseSettings(resp *sql.ElasticPoolPerDatabaseSettings) []interface{} { perDatabaseSettings := map[string]interface{}{} diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go b/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go index 5c4555b8bfba..f131eaa6c237 100644 --- a/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go +++ b/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go @@ -329,18 +329,27 @@ func testAccAzureRMMsSqlElasticPool_basic_DTU(data acceptance.TestData) string { } func testAccAzureRMMsSqlElasticPool_requiresImport(data acceptance.TestData) string { - template := testAccAzureRMMsSqlElasticPool_DTU_Template(data, "BasicPool", "Basic", 50, 5242880000, 0, 5, false) + template := testAccAzureRMMsSqlElasticPool_DTU_Template(data, "BasicPool", "Basic", 50, 4.8828125, 0, 5, false) return fmt.Sprintf(` %s resource "azurerm_mssql_elasticpool" "import" { - name = "${azurerm_mssql_elasticpool.test.name}" - resource_group_name = "${azurerm_mssql_elasticpool.test.resource_group_name}" - location = "${azurerm_mssql_elasticpool.test.location}" - server_name = "${azurerm_mssql_elasticpool.test.server_name}" - max_size_bytes = "${azurerm_mssql_elasticpool.test.max_size_bytes}" - sku = "${azurerm_mssql_elasticpool.test.sku}" - per_database_settings = "${azurerm_mssql_elasticpool.test.per_database_settings}" + name = "${azurerm_mssql_elasticpool.test.name}" + resource_group_name = "${azurerm_mssql_elasticpool.test.resource_group_name}" + location = "${azurerm_mssql_elasticpool.test.location}" + server_name = "${azurerm_mssql_elasticpool.test.server_name}" + max_size_gb = 4.8828125 + + sku { + name = "BasicPool" + tier = "Basic" + capacity = 50 + } + + per_database_settings { + min_capacity = 0 + max_capacity = 5 + } } `, template) }