Skip to content

Instantly share code, notes, and snippets.

View reespozzi's full-sized avatar

Rees Pozzi reespozzi

View GitHub Profile
@reespozzi
reespozzi / example.tf
Created February 3, 2023 15:42
Terraform Conditional Dynamic Block example
resource "azurerm_monitor_diagnostic_setting" "my_mds" {
name = "my-mds"
target_resource_id = azurerm_virtual_network.my_vnet.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.my_ws.id
dynamic "enabled_log" {
for_each = var.my_condition ? [1] : []
content {
category = "AuditEvent"
retention_policy {