Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_elastic_pool - Support for Fsv2 family #14250

Merged
merged 2 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions internal/services/mssql/helper/elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ var getvCoreMaxGB = map[string]map[string]map[int]float64{
40: 4096,
80: 4096,
},
"fsv2": {
8: 1024,
10: 1024,
12: 1024,
14: 1024,
16: 1536,
18: 1536,
20: 1536,
24: 1536,
32: 3072,
36: 3072,
72: 4096,
},
},
"businesscritical": {
"gen4": {
Expand Down Expand Up @@ -182,6 +195,7 @@ var getTierFromName = map[string]string{
"premiumpool": "Premium",
"gp_gen4": "GeneralPurpose",
"gp_gen5": "GeneralPurpose",
"gp_fsv2": "GeneralPurpose",
"bc_gen4": "BusinessCritical",
"bc_gen5": "BusinessCritical",
}
Expand Down Expand Up @@ -272,6 +286,10 @@ func getFamilyFromName(s sku) string {
retFamily = "Gen5"
}

if strings.EqualFold(nameFamily, "Fsv2") {
retFamily = "Fsv2"
}

return retFamily
}

Expand Down
3 changes: 2 additions & 1 deletion internal/services/mssql/mssql_elasticpool_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func resourceMsSqlElasticPool() *pluginsdk.Resource {
"GP_Gen5",
"BC_Gen4",
"BC_Gen5",
"GP_FSv2",
"GP_Fsv2",
}, true),
DiffSuppressFunc: suppress.CaseDifference,
},
Expand Down Expand Up @@ -107,6 +107,7 @@ func resourceMsSqlElasticPool() *pluginsdk.Resource {
ValidateFunc: validation.StringInSlice([]string{
"Gen4",
"Gen5",
"Fsv2",
}, true),
DiffSuppressFunc: suppress.CaseDifference,
},
Expand Down
19 changes: 19 additions & 0 deletions internal/services/mssql/mssql_elasticpool_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ func TestAccMsSqlElasticPool_resizeVCore(t *testing.T) {
})
}

func TestAccMsSqlElasticPool_fsv2FamilyVCore(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_mssql_elasticpool", "test")
r := MsSqlElasticPoolResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.fsv2VCore(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep("max_size_gb"),
})
}

func TestAccMsSqlElasticPool_licenseType(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_mssql_elasticpool", "test")
r := MsSqlElasticPoolResource{}
Expand Down Expand Up @@ -237,6 +252,10 @@ func (r MsSqlElasticPoolResource) basicVCore(data acceptance.TestData) string {
return r.templateVCore(data, "GP_Gen5", "GeneralPurpose", 4, "Gen5", 0.25, 4)
}

func (r MsSqlElasticPoolResource) fsv2VCore(data acceptance.TestData) string {
return r.templateVCore(data, "GP_Fsv2", "GeneralPurpose", 8, "Fsv2", 0, 8)
}

func (r MsSqlElasticPoolResource) basicVCoreMaxSizeBytes(data acceptance.TestData) string {
return r.templateVCoreMaxSizeBytes(data, "GP_Gen5", "GeneralPurpose", 4, "Gen5", 0.25, 4)
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/mssql_elasticpool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The following arguments are supported:

* `tier` - (Required) The tier of the particular SKU. Possible values are `GeneralPurpose`, `BusinessCritical`, `Basic`, `Standard`, or `Premium`. For more information see the documentation for your Elasticpool configuration: [vCore-based](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-vcore-resource-limits-elastic-pools) or [DTU-based](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-dtu-resource-limits-elastic-pools).

* `family` - (Optional) The `family` of hardware `Gen4` or `Gen5`.
* `family` - (Optional) The `family` of hardware `Gen4`, `Gen5` or `Fsv2`.

---

Expand Down