hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

mssql Hyperscale tier license_type error #23187

Closed galyehudaf5 closed 1 year ago

galyehudaf5 commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.5

AzureRM Provider Version

3.69.0

Affected Resource(s)/Data Source(s)

azurerm_mssql_elasticpool

Terraform Configuration Files

resource "azurerm_mssql_server" "mssql" {
  name                         = "sql-${var.naming_suffix}"
  resource_group_name          = "rg-${var.naming_suffix}-${var.mssql.resource_group_instance}"
  location                     = var.location
  version                      = var.mssql.version
  administrator_login          = var.mssql.administrator_login
  administrator_login_password = var.mssql.administrator_login_password
}

resource "azurerm_mssql_elasticpool" "mssql" {
  name                = "mssql_pool-${var.naming_suffix}"
  resource_group_name = "rg-${var.naming_suffix}-${var.mssql.resource_group_instance}"
  location            = var.location
  server_name         = azurerm_mssql_server.mssql.name
  max_size_gb         = var.mssql.max_size_gb
  sku {
    name     = var.mssql.sku_name
    tier     = var.mssql.tier
    capacity = var.mssql.capacity
    family   = var.mssql.family
  }

  per_database_settings {
    min_capacity = var.mssql.min_capacity
    max_capacity = var.mssql.max_capacity
  }

  depends_on = [azurerm_mssql_server.mssql]
}

mssql = {
  resource_group_instance      = "001"
  version                      = "12.0"
  administrator_login          = "4dm1n157r470r"
  administrator_login_password = "4-v3ry-53cr37-p455w0rd"
  max_size_gb                  = 756
  sku_name                     = "HS_Gen5"
  tier                         = "Hyperscale"
  capacity                     = 4
  family                       = "Gen5"
  min_capacity                 = 0.25
  max_capacity                 = 4
}

Debug Output/Panic Output

│ Error: `license_type` can only be configured when `sku.0.tier` is set to `GeneralPurpose` or `BusinessCritical`
│
│   with module.mssql.azurerm_mssql_elasticpool.mssql,
│   on ..\..\..\..\modules\mssql\main.tf line 10, in resource "azurerm_mssql_elasticpool" "mssql":
│   10: resource "azurerm_mssql_elasticpool" "mssql" {
│

Expected Behaviour

when sku tier is set to Hyperscale, license_type can't be set according to azurerm documentation.

Actual Behaviour

in the first terraform apply there were no errors but when I created more different resources I got the license_type error even though it doesn't exist in the configuration. if I look at the state for some reason I will see the license_type in the configuration. when I tried destroying and creating the resource I didn't get the error until it came back after creating more resources.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

github-actions[bot] commented 7 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.