Open sdahlbac opened 1 year ago
Testing with my latest version 1.x with the new data source (coming in the next release). Please confirm this is what you are expecting.
Same random_seed -> same suffix
data "azurecaf_name" "pfs" {
name = "fabric"
resource_type = "azurerm_postgresql_flexible_server"
prefixes = ["apac"]
random_seed = 3
random_length = 5
}
data "azurecaf_name" "vm" {
name = "fabric"
resource_type = "azurerm_resource_group"
prefixes = ["apac"]
random_seed = 3
random_length = 5
}
output "pfs" {
value = data.azurecaf_name.pfs.result
}
output "vm" {
value = data.azurecaf_name.vm.result
}
data.azurecaf_name.pfs: Reading...
data.azurecaf_name.vm: Reading...
data.azurecaf_name.pfs: Read complete after 0s [id=apac-psqlf-fabric-icvac]
data.azurecaf_name.vm: Read complete after 0s [id=apac-rg-fabric-icvac]
Changes to Outputs:
+ pfs = "apac-psqlf-fabric-icvac"
+ vm = "apac-rg-fabric-icvac"
Different random_seed -> different suffixes
data "azurecaf_name" "pfs" {
name = "fabric"
resource_type = "azurerm_postgresql_flexible_server"
prefixes = ["apac"]
# random_seed = 3
random_length = 5
}
data "azurecaf_name" "vm" {
name = "fabric"
resource_type = "azurerm_resource_group"
prefixes = ["apac"]
# random_seed = 3
random_length = 5
}
output "pfs" {
value = data.azurecaf_name.pfs.result
}
output "vm" {
value = data.azurecaf_name.vm.result
}
data.azurecaf_name.vm: Reading...
data.azurecaf_name.pfs: Reading...
data.azurecaf_name.vm: Read complete after 0s [id=apac-rg-fabric-ewywm]
data.azurecaf_name.pfs: Read complete after 0s [id=apac-psqlf-fabric-rtfev]
Changes to Outputs:
+ pfs = "apac-psqlf-fabric-rtfev"
+ vm = "apac-rg-fabric-ewywm"
kinda, but what I was having issues with was the Different random_seed -> different suffixes
terraform apply
(produced eg. yodgp)
terraform destroy
terraform apply
(still produced yodgp)
I have e.g.
Based on the documentation I thouht that not specifying a random_seed would use the timestamp as the seed, and thus would produce different
random_string
.terraform destroy
andterraform state rm module.base.azurecaf_name.db
but no matter what I do I still get
yodgp
?