# Who read the state file, and when. State contains every secret Terraform has # touched, so a read by someone unexpected is worth knowing about. resource "azurerm_log_analytics_workspace" "state" { name = "law-${var.name}" location = azurerm_resource_group.state.location resource_group_name = azurerm_resource_group.state.name sku = "PerGB2018" retention_in_days = var.log_retention_days tags = local.tags } resource "azurerm_monitor_diagnostic_setting" "state_access" { name = "state-blob-access" target_resource_id = "${azurerm_storage_account.state.id}/blobServices/default" log_analytics_workspace_id = azurerm_log_analytics_workspace.state.id enabled_log { category = "StorageRead" } enabled_log { category = "StorageWrite" } enabled_log { category = "StorageDelete" } }