Skip to content

Commit

Permalink
Merge pull request #13 from kumarvna/develop
Browse files Browse the repository at this point in the history
updating examples for version 2.2.0
  • Loading branch information
kumarvna authored Jul 18, 2021
2 parents 3c0e093 + 2acc4a7 commit 5795647
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module "vmscaleset" {
vmscaleset_name = "testvmss"
# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var. storage_account_name
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ module "vmscaleset" {
vmscaleset_name = "testvmss"
# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var.storage_account_name
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down Expand Up @@ -117,8 +117,8 @@ module "vmscaleset" {
vm_computer_name = "websrv1"
# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var.storage_account_name
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down
2 changes: 1 addition & 1 deletion examples/linux_vm_scale_sets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ module "vmscaleset" {
vmscaleset_name = "testvmss"
# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var.storage_account_name
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down
2 changes: 1 addition & 1 deletion examples/linux_vm_scale_sets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module "vmscaleset" {
vmscaleset_name = "testvmss"

# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var.storage_account_name

# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down
2 changes: 1 addition & 1 deletion examples/windows_vm_scale_sets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module "vmscaleset" {
vm_computer_name = "websrv1"
# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var.storage_account_name
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down
2 changes: 1 addition & 1 deletion examples/windows_vm_scale_sets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module "vmscaleset" {
vm_computer_name = "websrv1"

# (Optional) To enable Azure Monitoring and install log analytics agents
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
log_analytics_workspace_name = var.log_analytics_workspace_name
storage_account_name = var.storage_account_name

# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
# Defaults to `false`
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ resource "azurerm_monitor_diagnostic_setting" "vmmsdiag" {
count = var.log_analytics_workspace_name != null && var.storage_account_name != null ? 1 : 0
name = lower("${var.vmscaleset_name}-diag")
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
storage_account_id = data.azurerm_storage_account.storeacc.0.id
storage_account_id = var.storage_account_name != null ? data.azurerm_storage_account.storeacc.0.id : null
log_analytics_workspace_id = data.azurerm_log_analytics_workspace.logws.0.id

metric {
Expand All @@ -500,7 +500,7 @@ resource "azurerm_monitor_diagnostic_setting" "nsg" {
count = var.log_analytics_workspace_name != null && var.storage_account_name != null ? 1 : 0
name = lower("nsg-${var.vmscaleset_name}-diag")
target_resource_id = azurerm_network_security_group.nsg.id
storage_account_id = data.azurerm_storage_account.storeacc.0.id
storage_account_id = var.storage_account_name != null ? data.azurerm_storage_account.storeacc.0.id : null
log_analytics_workspace_id = data.azurerm_log_analytics_workspace.logws.0.id

dynamic "log" {
Expand Down

0 comments on commit 5795647

Please sign in to comment.