Skip to content

Commit

Permalink
update encryption_key_versionless_id assignments to handle null value…
Browse files Browse the repository at this point in the history
…s based on cmk encryption flag
  • Loading branch information
yuvalyaron committed Jan 1, 2025
1 parent 8d1be91 commit d9224d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module "azure_monitor" {
tre_core_tags = local.tre_core_tags
enable_local_debugging = var.enable_local_debugging
enable_cmk_encryption = var.enable_cmk_encryption
encryption_key_versionless_id = azurerm_key_vault_key.tre_encryption[0].versionless_id
encryption_key_versionless_id = var.enable_cmk_encryption ? azurerm_key_vault_key.tre_encryption[0].versionless_id : null
encryption_identity_id = var.enable_cmk_encryption ? azurerm_user_assigned_identity.encryption[0].id : null

depends_on = [
Expand Down
4 changes: 2 additions & 2 deletions templates/workspaces/base/terraform/workspace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module "airlock" {
airlock_processor_subnet_id = module.network.airlock_processor_subnet_id
arm_environment = var.arm_environment
enable_cmk_encryption = var.enable_cmk_encryption
encryption_key_versionless_id = azurerm_key_vault_key.encryption_key[0].versionless_id
encryption_key_versionless_id = var.enable_cmk_encryption ? azurerm_key_vault_key.encryption_key[0].versionless_id : null
encryption_identity_id = var.enable_cmk_encryption ? azurerm_user_assigned_identity.encryption_identity[0].id : null
depends_on = [
module.network,
Expand All @@ -80,7 +80,7 @@ module "azure_monitor" {
azure_monitor_agentsvc_dns_zone_id = module.network.azure_monitor_agentsvc_dns_zone_id
blob_core_dns_zone_id = module.network.blobcore_zone_id
enable_cmk_encryption = var.enable_cmk_encryption
encryption_key_versionless_id = azurerm_key_vault_key.encryption_key[0].versionless_id
encryption_key_versionless_id = var.enable_cmk_encryption ? azurerm_key_vault_key.encryption_key[0].versionless_id : null
encryption_identity_id = var.enable_cmk_encryption ? azurerm_user_assigned_identity.encryption_identity[0].id : null
enable_local_debugging = var.enable_local_debugging
depends_on = [
Expand Down

0 comments on commit d9224d6

Please sign in to comment.