Hi community,
I’m running a powershell scripts on my terraform script to create resources on azure and am having problems passing in map(string) as a parameter to the ps script.
The powershell script itself changes some subscription key values that are passed in as a parameter into the script. When i run this from the powershell cli, i have no problems passing in a hashtable. However when running it on terraform i get
“Error: Invalid template interpolation value: Cannot include the given value in a string template: string required.”
I am aware that terraform cannot interpolate a map(string) as a string, so hence the interpolation error. My question is then, how do we add a hashtable variable to a powershell command in terraform?
the command that i run is:
provisioner “local-exec” {
command = “./Scripts/SetSubscriptionsKeys.ps1 -resourceGroupName {azurerm_resource_group.rg.name} -apimServiceName {azurerm_api_management.apim.name} -adminSubscriptionKeys ${var.subscriptionKeys}”
interpreter = [“PowerShell”, “-Command”]
}
Thank you for your help.
Best regards,
Rui Vaz