aztfmod / terraform-provider-azurecaf

Terraform provider for the Terraform platform engineering for Azure
172 stars 91 forks source link

Length constraint for VM name #249

Open gregbaleyy opened 11 months ago

gregbaleyy commented 11 months ago

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/

gregbaleyy commented 11 months ago

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

RockyMM commented 3 months ago

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.