aztfmod / terraform-provider-azurecaf

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

azurerm_web_application_firewall_policy removes hyphens #218

Open andrewPoland opened 1 year ago

andrewPoland commented 1 year ago

I found the implementation for the web application firewall policy is removing hyphens despite them being a valid character.

Looking at #106 it seems like the name should have had the following

The slug chosen also doesn't match the abbreviation example given in caf best practices list

suggested breaking change below.

{
    "name": "azurerm_web_application_firewall_policy",
    "min_length": 1,
    "max_length": 80,
    "validation_regex": "\"^[a-zA-Z0-9][a-zA-Z0-9-._]{0,78}[a-zA-Z0-9_]$\"",
    "scope": "global",
    "slug": "waf",
    "dashes": true,
    "lowercase": false,
    "regex": "\"[^0-9A-Za-z-._]\""
},
gesnaud commented 1 month ago

Hi there!

Upvoting this issue! We are May 2024 and hyphen and slug still not respected:

Here is the azurecaf_name resource:

resource "azurecaf_name" "application_gateway_waf_policy" {
    clean_input   = true
    id            = "tnsobscmuhxkpfcj"
    name          = "weu-tst-sta"
    passthrough   = false
    random_length = 0
    resource_type = "azurerm_web_application_firewall_policy"
    result        = "wafwweutststa001"
    results       = {}
    separator     = "-"
    suffixes      = [
        "001",
    ]
    use_slug      = true
}

The result not matching with expectation:

Thanks!