Azure / terraform-azurerm-avm-res-compute-virtualmachinescaleset

MIT License
4 stars 6 forks source link

[AVM Question/Feedback]: Admin password should be optional for Linux VMSS #91

Open benhurjoel opened 1 day ago

benhurjoel commented 1 day ago

Check for previous/existing GitHub issues

Description

The variable 'admin_password' should be made optional for Linux VMSS. Because of this module composition, the 'admin_password' value is always expected even SSH keys are used

Image

Variable definition

Image

I cloned the code and made the following edit; it no longer shows the error. In my opinion, the admin password should be part of the OS Profile map, instead of being a separate variable. Please advise if I'm missing something.

      dynamic "linux_configuration" {
        for_each = os_profile.value.linux_configuration == null ? [] : [os_profile.value.linux_configuration]

        content {
          admin_username                  = linux_configuration.value.admin_username
          admin_password                  = try(var.admin_password, null)
terrymandin commented 5 hours ago

The OS password was made into a separate variable as it is sensitive to meet this requirement: ID: TFNFR19 - Category: Code Style - Sensitive Data Variables. I chose the second option and placed the password in a separate variable.