From a13b7a5b822b92649e35179161a44dbb2912f854 Mon Sep 17 00:00:00 2001 From: Christopher Yngvar Bull <110396296+chbul@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:18:29 +0100 Subject: [PATCH] feat(database): configure auto pause delay (#162) Co-authored-by: Henrik Simonsen Knutsen <46495473+hknutsen@users.noreply.github.com> --- modules/database/main.tf | 1 + modules/database/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/database/main.tf b/modules/database/main.tf index 2d2be4a..55df133 100644 --- a/modules/database/main.tf +++ b/modules/database/main.tf @@ -13,6 +13,7 @@ resource "azurerm_mssql_database" "this" { max_size_gb = var.max_size_gb sku_name = var.elastic_pool_id == null ? var.sku_name : "ElasticPool" storage_account_type = var.storage_account_type + auto_pause_delay_in_minutes = var.auto_pause_delay_in_minutes # Should be managed by owner of existing license, usually platform team. license_type = null diff --git a/modules/database/variables.tf b/modules/database/variables.tf index e54998a..233b7c4 100644 --- a/modules/database/variables.tf +++ b/modules/database/variables.tf @@ -139,3 +139,9 @@ variable "tags" { type = map(string) default = {} } + +variable "auto_pause_delay_in_minutes" { + description = "Time in minutes after which this SQL database is automatically paused. Value must be greater than 0 if using a SKU in the serverless compute tier." + type = number + default = 0 +}