I don't think that quite gets what I want unless the API is updated before my code is run. What I'm hoping to do is run
pulumi preview
and within my code that defines the infra know that it was
preview
that was ran, or
up
or
destory
or whatever else. I couldn't see anything showing that was possible but I wasn't sure if I was missing something.
👍 1
o
orange-policeman-59119
05/27/2022, 4:01 AM
@billions-wolf-76466 the "Dryrun" property is available in every SDK on the context (Go) or a function on the Pulumi package. It returns true if you're in a preview, or false if it's a real deploy.
On destroy, your Pulumi program doesn't run. Destroy works from all of the resources in the state of the stack, using the dependencies recorded in the state to destroy resources in reverse order.
b
billions-wolf-76466
05/27/2022, 8:25 AM
Thanks, I found that after asking on twitter too. Though I didn't know destroy didn't run my program but I guess it makes sense since it's not really needed for that.
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.