Open devblackops opened 3 years ago
We came across this issue as well building a module for MS SQL databases that would cover all possible sku's. As a temporary workaround, we have used a dynamic block where if the retention_days is set to 0, the block won't be processed. Without the block, the Hyperscale retention days defaults to 7 days which is the max for Hyperscale and what we wanted for it anyway.
dynamic "short_term_retention_policy" {
for_each = var.retention_days != "0" ? [var.retention_days] : []
content {
retention_days = var.retention_days
}
}
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_mssql_database
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Hyperscale database is created successfully with the desired
short_term_retention_policy
.Actual Behavior
Shortly after resource creation starts, the following error happens saying the
short_term_retention_policy
value is invalid (even though7
is a valid value (1-7 days) according to the docs. The DB can be created ifshort_term_retention_policy
is omitted but when adding it after the fact and running anapply
again produces the same error.Steps to Reproduce
terraform apply
Important Factoids
References
0000