Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Fix/log deprecation warning #32

Merged
merged 3 commits into from
Aug 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ resource "random_pet" "random" {}
data "azurerm_client_config" "this" {}

module "key_vault" {
source = "[email protected]:padok-team/terraform-azurerm-keyvault.git?ref=v0.4.0"
# checkov:skip=CKV_TF_1:Do not want to use commit tags for source ref
source = "[email protected]:padok-team/terraform-azurerm-keyvault.git?ref=v0.5.0"

name = random_pet.random.id # KeyVault names are globally unique
resource_group = azurerm_resource_group.this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ resource "random_pet" "random" {}
data "azurerm_client_config" "this" {}

module "key_vault" {
source = "[email protected]:padok-team/terraform-azurerm-keyvault.git?ref=v0.4.0"
# checkov:skip=CKV_TF_1:Do not want to use commit tags for source ref
source = "[email protected]:padok-team/terraform-azurerm-keyvault.git?ref=v0.5.0"

name = random_pet.random.id # KeyVault names are globally unique
resource_group = azurerm_resource_group.this
Expand Down
16 changes: 2 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ resource "azurerm_monitor_diagnostic_setting" "logs" {
name = "Diagnostic_logs"
target_resource_id = var.resources_to_logs[count.index]
log_analytics_workspace_id = var.log_analytics_workspace_id == null ? azurerm_log_analytics_workspace.this[0].id : var.log_analytics_workspace_id
dynamic "log" {
dynamic "enabled_log" {
for_each = data.azurerm_monitor_diagnostic_categories.logs[count.index].logs
content {
category = log.value
category = enabled_log.value
retention_policy {
enabled = false
days = 0
Expand Down Expand Up @@ -65,16 +65,4 @@ resource "azurerm_monitor_diagnostic_setting" "metrics" {
}
}
}
// Empty log to not polute terraform plan/apply
dynamic "log" {
for_each = data.azurerm_monitor_diagnostic_categories.metrics[count.index].logs
content {
category = log.value
enabled = false
retention_policy {
enabled = false
days = 0
}
}
}
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3"
version = ">= 3.40"
}
}
}