Skip to content

Commit

Permalink
use witness_type to control whether create witness_storage_key (#23)
Browse files Browse the repository at this point in the history
* use witness_type to control whether create witness_storage_key

update

* lower

---------

Co-authored-by: Hangyu Xu <[email protected]>
  • Loading branch information
xhy8759 and Hangyu Xu authored Oct 12, 2024
1 parent 084d09f commit 9316d57
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions keyvault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ resource "azurerm_key_vault_secret" "default_arb_application" {
}

resource "azurerm_key_vault_secret" "witness_storage_key" {
count = lower(var.witness_type) == "cloud" ? 1 : 0

key_vault_id = local.key_vault.id
name = local.keyvault_secret_names["WitnessStorageKey"]
value = base64encode(var.create_witness_storage_account ? azurerm_storage_account.witness[0].primary_access_key : data.azurerm_storage_account.witness[0].primary_access_key)
Expand Down

0 comments on commit 9316d57

Please sign in to comment.