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

able-rose-67471

09/25/2020, 8:11 AM
I currently have the default entry point:
static _Task_<int> Main() => Deployment.RunAsync<_AppStack_>();
The
AppStack
class is just one of the services for my applications supporting infrastructure. If I have other services, for example
PaymentApiStack
,
SmtpStack
, etc; is it possible to have multiple stacks in one Pulumi program or would I have to create many programs to achieve this? Or am I misunderstanding the purpose of a Stacks?
t

tall-librarian-49374

09/25/2020, 11:43 AM
One stack is one deployment, so while you could have many of them in the same C# project, you can not deploy them all at once. You could have a configuration value, read it in main, and then pick a proper stack class, if that makes sense.
a

able-rose-67471

09/25/2020, 12:39 PM
Yes makes perfect sense! Thanks for the clarification!
w

worried-city-86458

09/25/2020, 6:51 PM
@tall-librarian-49374 could that be done with
pulumi up -c
or do you mean config outside of the usual pulumi config? I presume the latter since it would be read before the deployment run is called?
This could be done with command-line arguments to the dotnet executable when the automation api supports dotnet
Also, given the automation api, you could presumably deploy multiple stacks from one dotnet project run by spinning up multiple automation “contexts”.
Would that work, @lemon-agent-27707 ?
t

tall-librarian-49374

09/25/2020, 7:26 PM
That’s a good point @worried-city-86458, our config won’t work outside a deployment.
l

lemon-agent-27707

09/27/2020, 12:59 PM
Yes this is a perfect use case for Automation API. @able-rose-67471 come join us in #automation-api. It's available in Go today. NodeJS is a work in progress and .NET and python will come right after.