Skip to content

Commit

Permalink
fix: Added variable for controlling key_creation
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed May 8, 2023
1 parent b91a281 commit 3d9bb3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ resource "azurerm_role_assignment" "rbac_user_assigned" {

resource "azurerm_key_vault_key" "example" {
depends_on = [azurerm_key_vault.key_vault, ]
count = var.enabled ? 1 : 0
count = var.enabled && var.key_enabled ? 1 : 0
name = format("mid-keyvault-%s", module.labels.id)
key_vault_id = join("", azurerm_key_vault.key_vault.*.id)
key_type = "RSA"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,8 @@ variable "multi_sub_vnet_link" {
description = "Flag to control creation of vnet link for dns zone in different subscription"
}

variable "key_enabled" {
type = bool
default = false
description = "Flag to control creation of key vault key resource."
}

0 comments on commit 3d9bb3e

Please sign in to comment.