damp-smartphone-91507
02/26/2025, 9:26 AMif (Environment.GetEnvironmentVariable("PULUMI_DRY_RUN") == "true")
{
return await Deployment.RunAsync<Stack>();
}
else
{
throw new NotSupportedException("Pulumi command is not supported");
}
The problem with this approach is, the preview is called first with the variable set on true and it never gets back to this context. Is there a way to get info what command was invoked ?echoing-dinner-19531
02/26/2025, 6:47 PMThe problem with this approach is, the preview is called first with the variable set on true and it never gets back to this contextIt should. I'm pretty sure the program gets invoked twice, once for preview, once for the actual up and it starts the whole program from scratch each time.
gray-ambulance-59402
02/27/2025, 9:30 AMpulumi preview
or if you run pulumi up
. As fraser mentioned if pulumi up
is run without --skip-preview
(of -if
) if will run the preview first but then not deploy.
It's worth bearing in mind that I don't believe this would stop pulumi destroy
from being run as this does not typically execute the program during destroy.