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.6k stars 4.64k forks source link

Serverless database does not accept license_type #26839

Closed zogamorph closed 2 months ago

zogamorph commented 3 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.4

AzureRM Provider Version

3.113.0

Affected Resource(s)/Data Source(s)

azurerm_mssql_database

Terraform Configuration Files

locals{
  IsNotServeless = true
}

resource "azurerm_mssql_database" "sqldatabase" {
  name                           = "sqldb-mydatabase"
  server_id                      = azurerm_mssql_server.ApplicationAzureSQLServer.id
  collation                      = "SQL_Latin1_General_CP1_CI_AS"
  create_mode                    = "Default"
  sku_name                       = local.IsNotServeless ? "GP_Gen5_4": "GP_S_Gen5_4"
  tags                           = local.MyTags
  license_type                   = local.IsProductionBuild ? "LicenseIncluded" : null
  min_capacity                   = 4
  max_size_gb                    = 50
  auto_pause_delay_in_minutes    = local.IsNotServeless ? -1 : 60
  zone_redundant                 = true

  lifecycle {
    prevent_destroy = true
  }
}

Debug Output/Panic Output

Error: serverless databases do not support license type

Expected Behaviour

It should convert database to serverless and remove the license_type

Actual Behaviour

Get error following error: Error: serverless databases do not support license type

Steps to Reproduce

With the local:IsNotServeless = true create the database

Update the local:IsNotServeless = false

and apply again

Important Factoids

No response

References

Here issues raise first: Serverless database does not accept license_type parameter

github-actions[bot] commented 1 month 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.