Skip to content

Commit

Permalink
updates requested in pr #2378
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Nov 22, 2018
1 parent 0fe8df0 commit 1aec685
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
25 changes: 3 additions & 22 deletions azurerm/resource_arm_mssql_elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ package azurerm

import (
"fmt"
"log"
"math"
"strings"
"time"

"github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
"log"
"math"
"strings"
)

func resourceArmMsSqlElasticPool() *schema.Resource {
Expand Down Expand Up @@ -159,15 +157,6 @@ func resourceArmMsSqlElasticPool() *schema.Resource {
},
},

"state": {
Type: schema.TypeString,
Computed: true,
},

"creation_date": {
Type: schema.TypeString,
Computed: true,
},

"max_size_bytes": {
Type: schema.TypeInt,
Expand All @@ -179,11 +168,6 @@ func resourceArmMsSqlElasticPool() *schema.Resource {
Computed: true,
},

"license_type": {
Type: schema.TypeString,
Computed: true,
},

"tags": tagsSchema(),
},

Expand Down Expand Up @@ -347,10 +331,7 @@ func resourceArmMsSqlElasticPoolRead(d *schema.ResourceData, meta interface{}) e
}

if properties := resp.ElasticPoolProperties; properties != nil {
d.Set("creation_date", properties.CreationDate.Format(time.RFC3339))
d.Set("license_type", string(properties.LicenseType))
d.Set("max_size_bytes", properties.MaxSizeBytes)
d.Set("state", string(properties.State))
d.Set("zone_redundant", properties.ZoneRedundant)

//todo remove in 2.0
Expand Down
6 changes: 1 addition & 5 deletions azurerm/resource_arm_mssql_elasticpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ func TestAccAzureRMMsSqlElasticPool_basic_DTU(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "sku.0.capacity", "50"),
resource.TestCheckResourceAttr(resourceName, "per_database_settings.0.min_capacity", "0"),
resource.TestCheckResourceAttr(resourceName, "per_database_settings.0.max_capacity", "50"),
resource.TestCheckResourceAttrSet(resourceName, "creation_date"),
resource.TestCheckResourceAttrSet(resourceName, "max_size_bytes"),
resource.TestCheckResourceAttrSet(resourceName, "state"),
resource.TestCheckResourceAttrSet(resourceName, "max_size_bytes"),
resource.TestCheckResourceAttrSet(resourceName, "zone_redundant"),
),
},
Expand Down Expand Up @@ -64,9 +62,7 @@ func TestAccAzureRMMsSqlElasticPool_basic_vCore(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "sku.0.family", "Gen5"),
resource.TestCheckResourceAttr(resourceName, "per_database_settings.0.min_capacity", "0.25"),
resource.TestCheckResourceAttr(resourceName, "per_database_settings.0.max_capacity", "4"),
resource.TestCheckResourceAttrSet(resourceName, "creation_date"),
resource.TestCheckResourceAttrSet(resourceName, "max_size_bytes"),
resource.TestCheckResourceAttrSet(resourceName, "state"),
resource.TestCheckResourceAttrSet(resourceName, "zone_redundant"),
),
},
Expand Down
4 changes: 3 additions & 1 deletion website/docs/r/mssql_elasticpool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ The following attributes are exported:

* `id` - The MsSQL Elastic Pool ID.

* `creation_date` - The creation date of the MsSQL Elastic Pool.
* `max_size_bytes` - The storage limit for the database elastic pool in bytes.

* `zone_redundant` - Whether or not this elastic pool is zone redundant.

## Import

Expand Down

0 comments on commit 1aec685

Please sign in to comment.