Is there a pulumi built in variable mentioning the...
# yaml
g
Is there a pulumi built in variable mentioning the update reference? I want to put a comment on a resource (Cloudflare DNS record) showing the particular update ID that deployed the record, so I can see when it changes and more easily identify which records are linked to which stack and which update/deployment. Currently I'm setting the comment to "Managed by Pulumi" but would like it to be "Managed by Pulumi. XYZ" where XYZ is some kind of unique dynamically updated ref.
l
@gifted-gigabyte-53859 there isn't at the moment. But if there was such a variable, the value of it would be different every run. If you would use this value as part of a description or comment field, the declarative nature of Pulumi would update that value on every run as a result. I guess that is not what you want.
g
@limited-rainbow-51650 thanks, actually that's exactly what I want. I want a unique identifier that updates with every
pulumi up
so I can tell when the resource was last touched by Pulumi and which update did it.
l
@gifted-gigabyte-53859 if we do this, I guess it is our engine which should keep track of that in the state. We currently only have the creation & modification date of the resources. But if you would use a value that we make accessible, and you use this to compose a description of a resource, then this resource would be updated at every single
pulumi up
run, even if there are no other input properties changed. This defeats the purpose of your intent.
g
True, if we were to use the modification date, this would either make the resources have a diff every update, or it would introduce a circular dependency. This would be a useful Pulumi feature to be able to conditionally add the unique 'run' or 'update' ID, or even a git hash, only if the resource is modified in another area. I guess I'll submit a feature request.
@limited-rainbow-51650 do you think this will be a significant effort?
l
@gifted-gigabyte-53859 I'm not a product engineer, so I can't comment on effort. But I propose you open an issue in our core Pulumi Git repository: https://github.com/pulumi/pulumi/issues