Azure / terraform-azurerm-avm-res-keyvault-vault

Azure Verified Module for Key Vault
https://registry.terraform.io/modules/Azure/avm-res-keyvault-vault/azurerm/latest
MIT License
21 stars 24 forks source link

[AVM Module Issue]: Key vault name validation incorrect #98

Closed captainhook closed 2 months ago

captainhook commented 4 months ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

0.5.3

(Optional) Correlation Id

No response

Description

The current condition for key vault name is condition = can(regex("^[a-z0-9-]{3,24}$", var.name)) which is not in line with Microsoft's guidance.

As per official documentation

Entity Scope Length Valid Characters
... ... ... ...
vaults global 3-24 Alphanumerics and hyphens.
Start with letter. End with letter or digit. Can't contain consecutive hyphens.

source: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules

matt-FFFFFF commented 3 months ago

This will be fixed in the next release

matt-FFFFFF commented 2 months ago

fixed by #113

captainhook commented 2 months ago

@matt-FFFFFF this is still incorrect.

Please re-open.

The correct restriction is: "Alphanumerics and hyphens. Start with letter. End with letter or digit. Can't contain consecutive hyphens."

However the current restriction only allows lowercase alphanumerics.

As per documentation: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault

matt-FFFFFF commented 2 months ago

Fixed in v0.6.3