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

Use log_category_types property instead of logs (Terraform) #2855

Merged
merged 7 commits into from
Nov 10, 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 @@ -33,6 +33,7 @@ ENHANCEMENTS:
* As part of the above change, the `auto_create` string passed to the `client_id` field in each Workspace template has now moved to an `auth_type` enum field, where the user can select the authentication type from a dropdown.
* Adds extra dns zones and links into core network ([#2828](https://github.com/microsoft/AzureTRE/pull/2828)).
* Add UI version to its footer card ([#2849](https://github.com/microsoft/AzureTRE/pull/2849)).
* Use `log_category_types` in `azurerm_monitor_diagnostic_categories` to remove deprecation warning ([#2855](https://github.com/microsoft/AzureTRE/pull/2855)).

BUG FIXES:
* Show the correct createdBy value for airlock requests in UI and in API queries ([#2779](https://github.com/microsoft/AzureTRE/pull/2779))
Expand Down
2 changes: 1 addition & 1 deletion templates/core/terraform/api-webapp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ resource "azurerm_monitor_diagnostic_setting" "webapp_api" {
log_analytics_workspace_id = module.azure_monitor.log_analytics_workspace_id

dynamic "log" {
for_each = data.azurerm_monitor_diagnostic_categories.api.logs
for_each = data.azurerm_monitor_diagnostic_categories.api.log_category_types
content {
category = log.value
enabled = contains(local.api_diagnostic_categories_enabled, log.value) ? true : false
Expand Down
14 changes: 12 additions & 2 deletions templates/core/terraform/azure-monitor/azure-monitor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,27 @@ resource "azurerm_storage_account" "az_monitor" {
}

resource "azurerm_log_analytics_linked_storage_account" "workspace_storage_ingestion" {
data_source_type = "ingestion"
data_source_type = "ingestion" # TODO: https://github.com/microsoft/AzureTRE/issues/2853
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.core.id
storage_account_ids = [azurerm_storage_account.az_monitor.id]

lifecycle {
# Remove with https://github.com/microsoft/AzureTRE/issues/2853
ignore_changes = [data_source_type]
}
}

resource "azurerm_log_analytics_linked_storage_account" "workspace_storage_customlogs" {
data_source_type = "customlogs"
data_source_type = "customlogs" # TODO: https://github.com/microsoft/AzureTRE/issues/2853
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.core.id
storage_account_ids = [azurerm_storage_account.az_monitor.id]

lifecycle {
# Remove with https://github.com/microsoft/AzureTRE/issues/2853
ignore_changes = [data_source_type]
}
}

resource "azurerm_monitor_private_link_scope" "ampls_core" {
Expand Down
2 changes: 1 addition & 1 deletion templates/core/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.41"
__version__ = "0.4.42"
14 changes: 12 additions & 2 deletions templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,27 @@ resource "azurerm_storage_account" "app_insights" {
}

resource "azurerm_log_analytics_linked_storage_account" "workspace_storage_ingestion" {
data_source_type = "ingestion"
data_source_type = "ingestion" # TODO: https://github.com/microsoft/AzureTRE/issues/2853
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.workspace.id
storage_account_ids = [azurerm_storage_account.app_insights.id]

lifecycle {
# Remove with https://github.com/microsoft/AzureTRE/issues/2853
ignore_changes = [data_source_type]
}
}

resource "azurerm_log_analytics_linked_storage_account" "workspace_storage_customlogs" {
data_source_type = "customlogs"
data_source_type = "customlogs" # TODO: https://github.com/microsoft/AzureTRE/issues/2853
resource_group_name = var.resource_group_name
workspace_resource_id = azurerm_log_analytics_workspace.workspace.id
storage_account_ids = [azurerm_storage_account.app_insights.id]

lifecycle {
# Remove with https://github.com/microsoft/AzureTRE/issues/2853
ignore_changes = [data_source_type]
}
}

resource "azurerm_monitor_private_link_scope" "workspace" {
Expand Down