Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyvault diagnostics in base workspace #2521

Merged
merged 3 commits into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ENHANCEMENTS:

* Adding Log Analytics & Antimalware VM extensions ([#2520](https://github.com/microsoft/AzureTRE/pull/2520))
* Gitea shared service support app-service standard SKUs ([#2523](https://github.com/microsoft/AzureTRE/pull/2523))
* Keyvault diagnostic settings in base workspace ([#2521](https://github.com/microsoft/AzureTRE/pull/2521))

BUG FIXES:

Expand Down
4 changes: 2 additions & 2 deletions templates/workspaces/base/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: tre-workspace-base
version: 0.3.25
version: 0.3.26
description: "A base Azure TRE workspace"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand Down Expand Up @@ -134,7 +134,7 @@ outputs:
mixins:
- exec
- terraform:
clientVersion: 1.2.6
clientVersion: 1.2.7
- az

install:
Expand Down
28 changes: 14 additions & 14 deletions templates/workspaces/base/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions templates/workspaces/base/terraform/keyvault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,35 @@ resource "azurerm_private_endpoint" "kvpe" {
}
}

resource "azurerm_monitor_diagnostic_setting" "kv" {
name = "diag-${local.keyvault_name}"
target_resource_id = azurerm_key_vault.kv.id
log_analytics_workspace_id = module.azure_monitor.log_analytics_workspace_id

dynamic "log" {
for_each = toset(["AuditEvent", "AzurePolicyEvaluationDetails"])
content {
category = log.value
enabled = true

retention_policy {
enabled = true
days = 365
}
}
}

metric {
category = "AllMetrics"
enabled = true

retention_policy {
enabled = true
days = 365
}
}
}

data "azurerm_user_assigned_identity" "resource_processor_vmss_id" {
name = "id-vmss-${var.tre_id}"
resource_group_name = "rg-${var.tre_id}"
Expand Down
2 changes: 1 addition & 1 deletion templates/workspaces/base/terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.16.0"
version = "=3.19.1"
}
azuread = {
source = "hashicorp/azuread"
Expand Down
1 change: 1 addition & 0 deletions templates/workspaces/base/terraform/workspace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ module "azure_monitor" {
enable_local_debugging = var.enable_local_debugging
depends_on = [
module.network,
module.airlock, # shouldn't be required, related to: https://github.com/microsoft/AzureTRE/issues/2357
]
}