aztfmod / terraform-azurerm-caf

Terraform supermodule for the Terraform platform engineering for Azure
https://aztfmod.github.io/documentation/
MIT License
562 stars 705 forks source link

Reference an existing boot diagnostics storage account & key vault for multiple VMSS across landing zones #938

Closed ianlimle closed 2 years ago

ianlimle commented 2 years ago

Hi @SergioMiyama I have a use case where I'm trying to reference a shared boot diagnostics storage account and shared key vault across multiple virtual machine scale sets.

In the existing infrastructure setup, we have an existing boot diagnostics storage account and key vault.

Is there a way for the virtual_machine_scale_sets resource to reference the same existing boot diagnostic storage account and existing key vault instead of creating new ones?

If possible, we would like to perform this referencing of the existing boot diagnostics storage account & key vault in CAF across landing zones.

The code block below works

virtual_machines = {

  vm1 = {
    resource_group_key                   = "vm_single_re2"
    provision_vm_agent                   = true
    os_type                              = "linux"
    keyvault_key                         = "kv1"
    boot_diagnostics_storage_account_key = "bootdiag1"

   ... 
florian-ried commented 2 years ago

@ianlimle I'm just facing the same question. How do I reference a central boot diagnostic storage account that is in a different landing zone for multiple VMs? I've tried the following, but unfortunately without success.

image

ianlim-cldcvr commented 2 years ago

@florian-ried we were able to point the vm to reference a central boot diagnostic storage account in a remote landing zone via this

virtual_machines = {

  vm1 = {
    lz_key = "remote_bootdiag"
    boot_diagnostics_storage_account_key = "bootdiag1"
   ...