Skip to content

Commit

Permalink
Merge pull request #209 from Azure/2106-UpdateExtensions
Browse files Browse the repository at this point in the history
Remote LZ support for extensions
  • Loading branch information
arnaudlh committed Jun 9, 2021
2 parents 939cb42 + cd07128 commit 7c7ba96
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions caf_solution/vm_extensions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
module "vm_extension_monitoring_agent" {
source = "aztfmod/caf/azurerm//modules/compute/virtual_machine_extensions"
version = "~>5.3.2"

depends_on = [module.solution]


# source = "/tf/caf/aztfmod/modules/compute/virtual_machine_extensions"

depends_on = [module.solution]

for_each = {
for key, value in try(var.virtual_machines, {}) : key => value
if try(value.virtual_machine_extensions.microsoft_enterprise_cloud_monitoring, null) != null
Expand All @@ -18,13 +20,15 @@ module "vm_extension_monitoring_agent" {
extension = each.value.virtual_machine_extensions.microsoft_enterprise_cloud_monitoring
extension_name = "microsoft_enterprise_cloud_monitoring"
settings = {
diagnostics = module.solution.diagnostics
diagnostics = merge(module.solution.diagnostics, local.diagnostics)
}
}

module "vm_extension_diagnostics" {
source = "aztfmod/caf/azurerm//modules/compute/virtual_machine_extensions"
version = "~>5.3.2"

# source = "/tf/caf/aztfmod/modules/compute/virtual_machine_extensions"

depends_on = [module.solution]

Expand All @@ -39,49 +43,53 @@ module "vm_extension_diagnostics" {
extension_name = "microsoft_azure_diagnostics"
settings = {
var_folder_path = var.var_folder_path
diagnostics = module.solution.diagnostics
diagnostics = merge(module.solution.diagnostics, local.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
}
}

module "vm_extension_microsoft_azure_domainjoin" {

# source = "git::https://github.com/aztfmod/terraform-azurerm-caf.git//modules/compute/virtual_machine_extensions?ref=master"
source = "aztfmod/caf/azurerm//modules/compute/virtual_machine_extensions"
version = "~>5.3.7"

depends_on = [module.solution] #refer landingzone.tf for the correct module name.
# source = "/tf/caf/aztfmod/modules/compute/virtual_machine_extensions"

# source = "git::https://github.com/aztfmod/terraform-azurerm-caf.git//modules/compute/virtual_machine_extensions?ref=master"

depends_on = [module.solution]

for_each = {
for key, value in try(var.virtual_machines, {}) : key => value
if try(value.virtual_machine_extensions.microsoft_azure_domainjoin, 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.
client_config = module.solution.client_config
virtual_machine_id = module.solution.virtual_machines[each.key].id
extension = each.value.virtual_machine_extensions.microsoft_azure_domainjoin
extension_name = "microsoft_azure_domainJoin"
keyvaults = module.solution.keyvaults
keyvaults = merge(tomap({ (var.landingzone.key) = module.solution.keyvaults }), try(local.remote.keyvaults, {}))
}

module "vm_extension_session_host_dscextension" {
source = "aztfmod/caf/azurerm//modules/compute/virtual_machine_extensions"
version = "~>5.3.7"

# source = "/tf/caf/aztfmod/modules/compute/virtual_machine_extensions"

# source = "git::https://github.com/aztfmod/terraform-azurerm-caf.git//modules/compute/virtual_machine_extensions?ref=master"

depends_on = [module.solution, module.vm_extension_microsoft_azure_domainjoin, module.solution.wvd_host_pools] #refer landingzone.tf for the correct module name.
depends_on = [module.vm_extension_microsoft_azure_domainjoin]

for_each = {
for key, value in try(var.virtual_machines, {}) : key => value
if try(value.virtual_machine_extensions.session_host_dscextension, 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.
client_config = module.solution.client_config
virtual_machine_id = module.solution.virtual_machines[each.key].id
extension = each.value.virtual_machine_extensions.session_host_dscextension
extension_name = "session_host_dscextension"
keyvaults = module.solution.keyvaults
wvd_host_pools = module.solution.wvd_host_pools
keyvaults = merge(tomap({ (var.landingzone.key) = module.solution.keyvaults }), try(local.remote.keyvaults, {}))
wvd_host_pools = merge(tomap({ (var.landingzone.key) = module.solution.wvd_host_pools }), try(local.remote.wvd_host_pools, {}))
}

0 comments on commit 7c7ba96

Please sign in to comment.