https://pulumi.com logo
#general
Title
# general
r

refined-plastic-19043

09/07/2023, 8:47 AM
Hello 🙂 Is there a way of updating specific tags by using custom resources transformation (e.g username and timestamp, git sha) only for resources that are actually going to be updated? How would you add git sha as tags to updated resources without applying new tag value to all existing resources in Pulumi deployment?
e

echoing-dinner-19531

09/07/2023, 12:48 PM
Not really doable at the moment, transformations are just run in the program as a pre-step to sending to the engine at the moment. But we are looking at over hauling how they work and this could be something that we look at supporting in the new system.
r

refined-plastic-19043

09/07/2023, 4:54 PM
Hi Fraser! Thanks for the response 🙂 That’s what I assumed after reading all the docs I could find. I wonder - let’s say that first I run
pulumi preview --save-plan=plan.json
and then during
pulumi up
I read that json and only apply ‘dynamic value’ tags for the resources that have create/update in that plan. Would that work?
The only problem for me was that I couldn’t really figure out how, from code perspective, which Pulumi command is being executed, whether it was
preview
or
up
- I saw
Deployment.Instance.IsDryRun
could I use that?
e

echoing-dinner-19531

09/07/2023, 4:57 PM
Yup DryRun tells you if it's preview or not