aztfmod / terraform-provider-azurecaf

Terraform provider for the Terraform platform engineering for Azure
173 stars 92 forks source link

CosmosDB Account Name #89

Closed arnaudlh closed 3 years ago

arnaudlh commented 3 years ago

As per: https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-database-account#create-database-account-via-portal

The name can only contain lowercase letters, numbers, and the hyphen (-) character. It must be between 3-44 characters in length.

Seems like we need to amend the definition:

{
        "name": "azurerm_cosmosdb_account",
        "min_length": 1,
        "max_length": 63,
        "validation_regex": "\"^[a-z0-9][a-zA-Z0-9-_.]{0,61}[a-zA-Z0-9]$\"",
        "scope": "resourceGroup",
        "slug": "cosmos",
        "dashes": true,
        "lowercase": false,
        "regex": "\"[^0-9A-Za-z_.-]\""
    },
Nepomuceno commented 3 years ago

It actually can only contain 31 chars The name can only contain lowercase letters, numbers, and the hyphen (-) character. It must be between 3-31 characters in length. I think they are reducing every day

but according to the docs it actually can do 44 https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftdocumentdb