aztfmod / terraform-provider-azurecaf

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

Incorrect resource group name construction [preview-2] #161

Open fargozhu opened 2 years ago

fargozhu commented 2 years ago

While using the preview-2 version, I came across with something that sounds incorrect accordingly with the documentation.

Code

resource "azurecaf_name" "caf_name" {
  name          = "heimdall"
  resource_type = "azurerm_resource_group"
  suffixes      = ["dev"]
  random_length = 5
  clean_input   = true
}

Expected

rg-heimdall-dev-kdjws

Actual

rg-heimdall-kdjws-dev

Exordian commented 2 years ago

same for 1.2.11 ; that's quite a blocker for us

Nepomuceno commented 2 years ago

But suffix comes after the random not before the random

Get Outlook for iOShttps://aka.ms/o0ukef


From: Exordian @.> Sent: Tuesday, June 7, 2022 2:48:20 PM To: aztfmod/terraform-provider-azurecaf @.> Cc: Subscribed @.***> Subject: Re: [aztfmod/terraform-provider-azurecaf] Incorrect resource group name construction [preview-2] (Issue #161)

same for 1.2.11 ; that's quite a blocker for us

— Reply to this email directly, view it on GitHubhttps://github.com/aztfmod/terraform-provider-azurecaf/issues/161#issuecomment-1148702173, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAA2AFJPFCIRRSMD7MRRJRLVN5HKJANCNFSM5RI5S6SA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Exordian commented 2 years ago

According to the documentation: https://github.com/aztfmod/terraform-provider-azurecaf#example-usage

The example above would generate a name using the pattern [prefix]-[cafprefix]-[name]-[postfix]-[5_random_chars]:

There should be a "postfix" before the random characters. Suffix is not mentioned at all. I did assume that postfix is a synonym to suffix. I'd also argue that the the position of the string "postfix" will be more used than a suffix at the very end.