This message was deleted.
s
This message was deleted.
b
Current implementation:
Copy code
# registerAutoTags registers a global stack transformation that merges a set
# of tags with whatever was also explicitly added to the resource definition.
def register_auto_tags(auto_tags):
    pulumi.runtime.register_stack_transformation(lambda args: auto_tag(args, auto_tags))


# auto_tag applies the given tags to the resource properties if applicable.
def auto_tag(args, auto_tags):
    if is_taggable(args.type_):
        args.props["tags"] = {**auto_tags, **(args.props["tags"] or {})}
        return pulumi.ResourceTransformationResult(args.props, args.opts)
w
I'm not certain off the top of my head - but it's possible that the resource options property on the args has an
id
property set only in the case of read. If so you may be able to use that to decide whether to apply the transformation?