rapid-raincoat-36492
01/31/2022, 9:41 PMbored-oyster-3147
01/31/2022, 9:54 PM.map(...)
call where the resources are declared.rapid-raincoat-36492
01/31/2022, 10:04 PMObject.entries
on a pulumi.Output
type if I'm understanding it correctly.
Wouldn't that have the same effect?bored-oyster-3147
01/31/2022, 10:42 PMvar option1 = exampleCert.domainValidationOptions.apply(options => options[0]);
// declare first dns record
var option2 = exampleCert.domainValidationOptions.apply(options => options[1]);
// declare second dns record
Obviously that means if your cert's SAN count changes than you'd have to update the code, but if your preview being consistent is important to you it is an option.echoing-dinner-19531
02/01/2022, 9:21 AMvar options = new Option[4];
for i in 0 to 4 do:
options[i] = exampleCert.domainValidationOptions.apply(options => options[i]);
The array and loop aren't the problem, it's the unknown size that's tricky.
In fact we could probably write a helper to do this for you, given an Output<T[]> and an expected size return an Output<T>[] of that size and throw an error if at update time the size didn't match. Raise a github issue if that sounds worthwhile.