Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vm_extension.tf to caf_solution #177

Merged
merged 1 commit into from
May 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions caf_solution/vm_extensions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# microsoft_enterprise_cloud_monitoring - Install the monitoring agent in the virtual machine
#

module "vm_extension_monitoring_agent" {
source = "../../modules/compute/virtual_machine_extensions"
# if you are not running CAF modules locally, change the source to "github.com/aztfmod/terraform-azurerm-caf/modules/compute/virtual_machine_extensions"
depends_on = [module.solution] #refer landingzone.tf for the correct module name.

for_each = {
for key, value in try(var.virtual_machines, {}) : key => value
if try(value.virtual_machine_extensions.microsoft_enterprise_cloud_monitoring, null) != null
}

client_config = module.solution.client_config #refer landingzone.tf for the correct module name.
virtual_machine_id = module.solution.virtual_machines[each.key].id #refer landingzone.tf for the correct module name.
extension = each.value.virtual_machine_extensions.microsoft_enterprise_cloud_monitoring
extension_name = "microsoft_enterprise_cloud_monitoring"
settings = {
diagnostics = module.solution.diagnostics
}
}

module "vm_extension_diagnostics" {
source = "../../modules/compute/virtual_machine_extensions"
# if you are not running CAF modules locally, change the source to "github.com/aztfmod/terraform-azurerm-caf/modules/compute/virtual_machine_extensions"
depends_on = [module.solution] #refer landingzone.tf for the correct module name.

for_each = {
for key, value in try(var.virtual_machines, {}) : key => value
if try(value.virtual_machine_extensions.microsoft_azure_diagnostics, null) != null
}

client_config = module.solution.client_config #refer landingzone.tf for the correct module name.
virtual_machine_id = module.solution.virtual_machines[each.key].id #refer landingzone.tf for the correct module name.
extension = each.value.virtual_machine_extensions.microsoft_azure_diagnostics
extension_name = "microsoft_azure_diagnostics"
settings = {
var_folder_path = var.var_folder_path
diagnostics = module.solution.diagnostics
xml_diagnostics_file = try(each.value.virtual_machine_extensions.microsoft_azure_diagnostics.xml_diagnostics_file, null)
diagnostics_storage_account_keys = each.value.virtual_machine_extensions.microsoft_azure_diagnostics.diagnostics_storage_account_keys
}
}