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

MIT License
4 stars 10 forks source link

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

Closed benhurjoel closed 1 month ago

benhurjoel commented 1 month 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 1 month 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.

benhurjoel commented 1 month ago

Thank you @terrymandin . That clarifies.