generated from Azure/terraform-verified-module
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresources.sqlsvr.locks.tf
21 lines (19 loc) · 1.05 KB
/
resources.sqlsvr.locks.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#------------------------------------------------------------------
# Azure SQl Database Lock configuration - Default (required).
#------------------------------------------------------------------
resource "azurerm_management_lock" "primary_sql_level_lock" {
count = var.enable_resource_locks ? 1 : 0
name = "${local.primary_server_name}-${var.lock_level}-lock"
scope = azurerm_mssql_server.primary_sql.id
lock_level = var.lock_level
notes = "Azure SQl Server Primary '${local.primary_server_name}' is locked with '${var.lock_level}' level."
}
resource "azurerm_management_lock" "secondary_sql_level_lock" {
count = var.enable_resource_locks && var.enable_failover_group ? 1 : 0
name = "${local.secondary_server_name}-${var.lock_level}-lock"
scope = azurerm_mssql_server.secondary_sql.0.id
lock_level = var.lock_level
notes = "Azure SQl Server Secondary '${local.secondary_server_name}' is locked with '${var.lock_level}' level."
}