-
Notifications
You must be signed in to change notification settings - Fork 110
[FEATURE] Support for hashicorp/random #3773
Copy link
Copy link
Open
Labels
.NETPull requests that update .net codePull requests that update .net codefeature: pre-flight-expansionIssues relating to expansion of ARM and Bicep.Issues relating to expansion of ARM and Bicep.feature: terraformSupport for expansion with Terraform.Support for expansion with Terraform.
Description
Activity
Metadata
Metadata
Assignees
Labels
.NETPull requests that update .net codePull requests that update .net codefeature: pre-flight-expansionIssues relating to expansion of ARM and Bicep.Issues relating to expansion of ARM and Bicep.feature: terraformSupport for expansion with Terraform.Support for expansion with Terraform.
Your suggestion
Investigate emulating common hashicorp terraform providers functions like
random_stringfromhashicorp/randomthat are likely to be encountered by customers.For example, the following code would not work currently if
var.container_registry_nameis not set becauserandom_string.acr_name.resultis calculated at apply time so the result is an empty name field. The current implementation will skip a resource if the name is set to an empty string.While the intent is that the name is random (the first apply), for testing with PSRule it may make sense to make this appear random but deterministic taking parameters from the resource definition name to seed then getting the N'th variation based on how many times it's called. Otherwise subsequent runs would report a different name.
Alternatives
n/a
Additional context