Hi, I'm very familiar with Pulumi, but I'm struggling to find a solution for when I need to have a conditional resource creation. In my specific example I have a domain name which is an Output; I want to create a DNS entry, but based on the suffix of the domain name it can either be an AWS DNS entry or an Azure DNS entry. I can't find a way to query the Output and get the correct information. I've tried to shove all the logic inside a method and then have everything running via a lambda on an Output.apply(): that works when doing pulumi up, but pulumi pre will not show those resources, for whatever reason (probably lack of information during the pre run). Any thoughts on this?
12/09/2021, 1:22 AM
Possibly split it into two stacks so that the output value is known in advance?
12/09/2021, 1:59 AM
yeah, unfortunately there's not a great answer here just yet. we have some designs in process that might make this process a bit better, but unfortunately for the time being, you're stuck creating resources inside an apply i'm afraid