Reputation: 103
Using Terraform, how do I set the Azure SQL Database (and Azure Elastic Pool) LicenseType property to enable Azure Hybrid Use Benefit (aka AHUB, aka AHB)?
Here's an example using Powershell:
# Azure SQL Database:
Set-AzSqlDatabase -DatabaseName $sqlDb.DatabaseName -ResourceGroupName $sqlDb.ResourceGroupName -ServerName $sqlDb.ServerName -LicenseType "BasePrice"
# Azure SQL Database Elastic Pool:
Set-AzSqlElasticPool -ElasticPoolName $elasticPool.elasticPoolName -ResourceGroupName $elasticPool.ResourceGroupName -ServerName $elasticPool.ServerName -LicenseType "BasePrice"
The property is easily set using Az CLI too.
This is a very important property (from a cost perspective) and I cannot find mention of it anywhere in the context of Terraform.
Thanks!
Upvotes: 2
Views: 3770
Reputation: 51
Hashicorp's site doesn't make this setting clear. The setting description is present, but the expanded description of the possible values is not. Combining Hashicorp's site with Microsoft's, we get:
license_type - (Optional) Specifies the license type applied to this database. Possible values are:
Sources:
Upvotes: 3
Reputation: 1245
Why does it seem LicenseIncluded
= the "Save Money" box being unchecked. I would have thought LicenseIncluded
would have add the box checked and BasePrice
would be unchecked, but in practice it is the opposite.
Upvotes: 0
Reputation: 516
From Terraform documentation
license_type - (Optional) Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
Here is the link https://www.terraform.io/docs/providers/azurerm/r/mssql_elasticpool.html#license_type
Upvotes: 1