broad-island-71889
05/17/2022, 7:08 PMbucket = aws.s3.Bucket.get(
f"{name}-some-bucket", id=f"bucket-created-in-another-program")
)
I was wondering if there is a way to filter auto-tagging by the operation, i.e. if it’s only reading resources, then do not apply the transformation.
aws:s3/bucket:Bucket: (read)
# 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)
white-balloon-205
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?