Skip to content

Commit

Permalink
Update Terraform lock
Browse files Browse the repository at this point in the history
  • Loading branch information
frasermolyneux committed Feb 8, 2024
1 parent 3c5b3f4 commit 3c7214a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions terraform/common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ resource "azurerm_resource_group" "rg" {
}

resource "azurerm_management_lock" "rg_lock" {
count = var.environment == "prd" ? 1 : 0

name = "Terraform (CanNotDelete) - ${random_id.lock.hex}"
scope = azurerm_resource_group.rg.id
lock_level = "CanNotDelete"
Expand Down
2 changes: 2 additions & 0 deletions terraform/key_vault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ resource "azurerm_key_vault" "kv" {
}

resource "azurerm_management_lock" "kv_lock" {
count = var.environment == "prd" ? 1 : 0

name = "Terraform (CanNotDelete) - ${random_id.lock.hex}"
scope = azurerm_key_vault.kv.id
lock_level = "CanNotDelete"
Expand Down

0 comments on commit 3c7214a

Please sign in to comment.