I currently have the default entry point: `static ...
# dotnet
a
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
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
Yes makes perfect sense! Thanks for the clarification!
w
@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
That’s a good point @worried-city-86458, our config won’t work outside a deployment.
l
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.