Hey all :wave: ! Is there a canonical way to retur...
# general
i
Hey all 👋 ! Is there a canonical way to return a stub
Resource
for a downstream
DependsOn
? I saw
Resource
has a
dependency
flag, which when set to
true
looks like it does what I want, but wasn’t sure if I should be depending on that behavior or not? For example, I have two cloud providers, but only one of them need to generate the resource, so the other would generate a stub to abstract to a common code flow like so:
Copy code
var stubOrConcreteResource = GetSomeResourceFromProvider();
var anotherResource = new SomeResource("myname", new SomeArgs(), new CustomerResourceOptions() { DependsOn = { stubOrConcreteResource });
Thanks!
Actually, I’ll just return
null
instead of a Stub and filter those out to make the
DependsOn
happy I think 🤔