aztfmod / terraform-provider-azurecaf

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

when random_length > zero, generated name does not comply with readme #127

Closed gilles-o closed 2 years ago

gilles-o commented 2 years ago

The readme says:

random_length (optional) - default to 0 : configure additional characters to append to the generated resource name. Random characters will remain compliant with the set of allowed characters per resources and will be appended after the suffixes

The random part is in fact inserted between name and suffixes, which is not the expected behavior.

azurecaf_name "test" {}
  random_length = 5
  name = "some-name"
  suffixes = ["component", "env", "location"]
azurecaf_name "test" {}
  random_length = 5
  name = ""
  suffixes = ["some-name", "component", "env", "location"]

Suggested fix: change the components order (but will induce a breaking change) or change the doc

arnaudlh commented 2 years ago

good feeback @gilles-o, amended the doc!.