Skip to content

Commit be752a8

Browse files
committed
adding support to terraform v0.13
1 parent 03767a6 commit be752a8

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

main.tf

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,10 @@ resource "azurerm_monitor_autoscale_setting" "auto" {
425425
}
426426
}
427427

428-
#--------------------------------------------------
429-
# Azure Log Analytics Workspace Agent Installation
430-
#--------------------------------------------------
431-
resource "azurerm_virtual_machine_scale_set_extension" "omsagent" {
428+
#--------------------------------------------------------------
429+
# Azure Log Analytics Workspace Agent Installation for windows
430+
#--------------------------------------------------------------
431+
resource "azurerm_virtual_machine_scale_set_extension" "omsagentwin" {
432432
count = var.log_analytics_workspace_name != null && var.os_flavor == "windows" ? 1 : 0
433433
name = "OmsAgentForWindows"
434434
publisher = "Microsoft.EnterpriseCloud.Monitoring"
@@ -450,6 +450,31 @@ resource "azurerm_virtual_machine_scale_set_extension" "omsagent" {
450450
PROTECTED_SETTINGS
451451
}
452452

453+
#--------------------------------------------------------------
454+
# Azure Log Analytics Workspace Agent Installation for Linux
455+
#--------------------------------------------------------------
456+
resource "azurerm_virtual_machine_scale_set_extension" "omsagentlinux" {
457+
count = var.log_analytics_workspace_name != null && var.os_flavor == "linux" ? 1 : 0
458+
name = "OmsAgentForLinux"
459+
publisher = "Microsoft.EnterpriseCloud.Monitoring"
460+
type = "OmsAgentForLinux"
461+
type_handler_version = "1.13"
462+
auto_upgrade_minor_version = true
463+
virtual_machine_scale_set_id = azurerm_linux_virtual_machine_scale_set.linux_vmss.0.id
464+
465+
settings = <<SETTINGS
466+
{
467+
"workspaceId": "${data.azurerm_log_analytics_workspace.logws.0.workspace_id}"
468+
}
469+
SETTINGS
470+
471+
protected_settings = <<PROTECTED_SETTINGS
472+
{
473+
"workspaceKey": "${data.azurerm_log_analytics_workspace.logws.0.primary_shared_key}"
474+
}
475+
PROTECTED_SETTINGS
476+
}
477+
453478
#--------------------------------------
454479
# azurerm monitoring diagnostics
455480
#--------------------------------------

0 commit comments

Comments
 (0)