ACTIVEPIECES/deploy/pulumi/autotag.ts
rohit cd823a2d9e
Some checks failed
Crowdin Action / synchronize-with-crowdin (push) Has been cancelled
Release Pieces / Release-Pieces (push) Has been cancelled
automaton layer
2025-07-05 23:59:03 +05:30

16 lines
597 B
TypeScript

import * as pulumi from "@pulumi/pulumi";
import { isTaggable } from "./taggable";
/**
* registerAutoTags registers a global stack transformation that merges a set
* of tags with whatever was also explicitly added to the resource definition.
*/
export function registerAutoTags(autoTags: Record<string, string>): void {
pulumi.runtime.registerStackTransformation((args) => {
if (isTaggable(args.type)) {
args.props["tags"] = { ...args.props["tags"], ...autoTags };
return { props: args.props, opts: args.opts };
}
return undefined;
});
}