File tree Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ module "vmscaleset" {
3737 vmscaleset_name = "testvmss"
3838
3939 # (Optional) To enable Azure Monitoring and install log analytics agents
40+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
4041 log_analytics_workspace_name = var.log_analytics_workspace_name
41- storage_account_name = var. storage_account_name
4242
4343 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
4444 # Defaults to `false`
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ module "vmscaleset" {
2727 vmscaleset_name = "testvmss"
2828
2929 # (Optional) To enable Azure Monitoring and install log analytics agents
30+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
3031 log_analytics_workspace_name = var.log_analytics_workspace_name
31- storage_account_name = var.storage_account_name
3232
3333 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
3434 # Defaults to `false`
@@ -117,8 +117,8 @@ module "vmscaleset" {
117117 vm_computer_name = "websrv1"
118118
119119 # (Optional) To enable Azure Monitoring and install log analytics agents
120+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
120121 log_analytics_workspace_name = var.log_analytics_workspace_name
121- storage_account_name = var.storage_account_name
122122
123123 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
124124 # Defaults to `false`
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ module "vmscaleset" {
2121 vmscaleset_name = "testvmss"
2222
2323 # (Optional) To enable Azure Monitoring and install log analytics agents
24+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
2425 log_analytics_workspace_name = var.log_analytics_workspace_name
25- storage_account_name = var.storage_account_name
2626
2727 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
2828 # Defaults to `false`
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ module "vmscaleset" {
1414 vmscaleset_name = " testvmss"
1515
1616 # (Optional) To enable Azure Monitoring and install log analytics agents
17+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
1718 log_analytics_workspace_name = var. log_analytics_workspace_name
18- storage_account_name = var. storage_account_name
1919
2020 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
2121 # Defaults to `false`
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ module "vmscaleset" {
2222 vm_computer_name = "websrv1"
2323
2424 # (Optional) To enable Azure Monitoring and install log analytics agents
25+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
2526 log_analytics_workspace_name = var.log_analytics_workspace_name
26- storage_account_name = var.storage_account_name
2727
2828 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
2929 # Defaults to `false`
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ module "vmscaleset" {
1515 vm_computer_name = " websrv1"
1616
1717 # (Optional) To enable Azure Monitoring and install log analytics agents
18+ # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
1819 log_analytics_workspace_name = var. log_analytics_workspace_name
19- storage_account_name = var. storage_account_name
2020
2121 # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
2222 # Defaults to `false`
Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ resource "azurerm_monitor_diagnostic_setting" "vmmsdiag" {
484484 count = var. log_analytics_workspace_name != null && var. storage_account_name != null ? 1 : 0
485485 name = lower (" ${ var . vmscaleset_name } -diag" )
486486 target_resource_id = var. os_flavor == " windows" ? azurerm_windows_virtual_machine_scale_set. winsrv_vmss . 0 . id : azurerm_linux_virtual_machine_scale_set. linux_vmss . 0 . id
487- storage_account_id = data. azurerm_storage_account . storeacc . 0 . id
487+ storage_account_id = var . storage_account_name != null ? data. azurerm_storage_account . storeacc . 0 . id : null
488488 log_analytics_workspace_id = data. azurerm_log_analytics_workspace . logws . 0 . id
489489
490490 metric {
@@ -500,7 +500,7 @@ resource "azurerm_monitor_diagnostic_setting" "nsg" {
500500 count = var. log_analytics_workspace_name != null && var. storage_account_name != null ? 1 : 0
501501 name = lower (" nsg-${ var . vmscaleset_name } -diag" )
502502 target_resource_id = azurerm_network_security_group. nsg . id
503- storage_account_id = data. azurerm_storage_account . storeacc . 0 . id
503+ storage_account_id = var . storage_account_name != null ? data. azurerm_storage_account . storeacc . 0 . id : null
504504 log_analytics_workspace_id = data. azurerm_log_analytics_workspace . logws . 0 . id
505505
506506 dynamic "log" {
You can’t perform that action at this time.
0 commit comments