https://pulumi.com logo
Title
w

white-chef-55657

08/04/2022, 12:10 PM
I couldn’t find in the docs of the pulumi package, but is there a way to check if I’m currently in preview/update/destroy etc. ?
w

worried-rain-74420

08/09/2022, 5:16 PM
To clarify, are you asking if there’s a way to inspect the current operation from inside your TypeScript program? Something like:
if (process.env["PULUMI_OPERATION"] === "PREVIEW") {
    // Perform logic specific to PREVEW operations
} else {
   // Handle Update/Destroy/Up cases
}
w

white-chef-55657

08/11/2022, 1:26 PM
wonderful thanks
w

worried-rain-74420

08/11/2022, 2:14 PM
Ah, sorry @white-chef-55657 I wasn’t suggesting that already exists, sorry! I’m unsure if it does or not! I wanted to understand your question better.
w

white-chef-55657

08/11/2022, 4:45 PM
yes - that’s what I’m looking for
is there such thing?
I’m having to write some custom code due to missing provider, want to ensure it only runs in update and not preview
I think this does it
👍 1
🙌 1