aztfmod/terraform-provider-azurecaf

Length constraint for VM name

gregbaleyy opened this issue · 2 comments

For windows VM and VMSS name, we are limited to a max length of 15 characters where as we should have up to 64 characters according to https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.VM.Name/

It looks like you enforced limits of computer name on VM name
https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.VM.ComputerName/

I also see this behaviour. All resource_types that are related to VMs, i.e. azurerm*_virtual_machine produce results which are not according to CAF.

E.g.

resource "azurecaf_name" "vm" {

  resource_type = "azurerm_windows_virtual_machine"

  name = "012345678901234567"

  suffixes = [
    "dev",
    "westeurope"
  ]

}

output "vm_name" {
  value = azurecaf_name.vm.result
}

The result is vm-dev which is unexpected. Upon reading more about the topic, it is expected.