https://pulumi.com logo
#dotnet
Title
# dotnet
m

miniature-leather-70472

09/25/2020, 4:26 PM
probably missing something obvious but how can I take an array in a stack config file and trun it into a C# array?
c

chilly-hairdresser-56259

09/25/2020, 5:00 PM
I was importing it as a JsonElement then iterate over that
m

microscopic-pilot-97530

09/25/2020, 9:24 PM
Set the array from the command line:
Copy code
pulumi config set --path names[0] a
pulumi config set --path names[1] b
pulumi config set --path names[2] c
Access from C# Pulumi program:
Copy code
var config = new Config();
var names = config.RequireObject<string[]>("names");
m

miniature-leather-70472

09/28/2020, 12:57 PM
Thanks, that's all working now
3 Views