What's the best way to unwrap all the outputs of a...
# azure
g
What's the best way to unwrap all the outputs of a component to then apply some custom logic (e.g., seed a database container)? What I'm trying to do is to seed a cosmos container when the CosmosComponent (ComponentResource) is created..feels like I need to chain Apply() methods in order to unwrap all the properties I need for the CosmosClient
t
chain Apply() methods
You can use
Output.Tuple
(assuming C#) instead of chaining, as in https://github.com/pulumi/examples/blob/master/azure-cs-appservice/AppServiceStack.cs#L130
g
Ah nice that's very useful thank you. Also, is it reasonable to use apply like that - to cause side-effects rather than just returning another output? I can't think of a better way for seeding a container using C#
t
It’s okay if you are fine with it running multiple times - every
up
basically
g
yeah should be fine, thanks
t
We still don’t have dynamic providers for C# that would be a better option