It actually works fine to just do what I want inside an
.apply
function, but it executes every time I run pulumi, not just when I say “yes” to performing an update.
w
white-balloon-205
03/05/2019, 4:41 PM
You can use
pulumi.runtime.isDryRun
to test whether a preview is being run and only run some code if it is not a preview (aka "dry run").
The richest way to do this is with Dynamic Providers, which let you define your own Create, Read, Update and Delete steps for some virtual "resource" in JavaScript. This is very flexible, but quite low level currently and not yet well documented (docs coming soon).
But right now, an
.apply
with
isDryRun
should generally work well in many cases.
b
bitter-island-28909
03/05/2019, 4:42 PM
cool, thank you!
bitter-island-28909
03/05/2019, 4:43 PM
looking forward to those docs on Dynamic Providers, sounds super powerful
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.