sparse-intern-71089
01/27/2021, 4:36 PMprehistoric-kite-30979
01/27/2021, 4:37 PMexport function registerAutoTags(tags?: Record<string, string>): void {
const metadata = new pulumi.Config("tetrate:metadata")
pulumi.runtime.registerStackTransformation((args) => {
if (isTaggable(args.type)) {
args.props["tags"] = { ...args.props["tags"], ...tags, ...{
"pulumi:project": pulumi.getProject(),
"pulumi:stack": pulumi.getStack(),
"tetrate:owner": metadata.require("owner"),
"tetrate:source": metadata.require("source"),
} }
return { props: args.props, opts: args.opts }
}
return undefined
})
}
prehistoric-kite-30979
01/27/2021, 4:37 PMprehistoric-kite-30979
01/27/2021, 4:37 PMbrave-planet-10645
01/27/2021, 4:45 PMbrave-planet-10645
01/27/2021, 4:46 PMbrave-planet-10645
01/27/2021, 4:57 PMmetadata.require
in there. I would pass in the metadata to the parameters of the registerAutoTags
methodprehistoric-kite-30979
01/27/2021, 7:06 PMprehistoric-kite-30979
01/27/2021, 7:07 PMexport function registerAutoTags(tags?: Record<string, string>): void {
pulumi.runtime.registerStackTransformation((args) => {
if (isTaggable(args.type)) {
args.props["tags"] = { ...args.props["tags"], ...tags, ...{
"test": "test",
} }
return { props: args.props, opts: args.opts }
}
return undefined
})
}
prehistoric-kite-30979
01/27/2021, 7:15 PMexport function registerAutoTags(tags?: Record<string, string>): void {
pulumi.runtime.registerStackTransformation((args) => {
return undefined
})
}
same error here ^^little-cartoon-10569
01/27/2021, 7:56 PMprehistoric-kite-30979
01/27/2021, 9:32 PMprehistoric-kite-30979
01/27/2021, 9:32 PMlittle-cartoon-10569
01/27/2021, 9:41 PMlittle-cartoon-10569
01/27/2021, 9:41 PMlittle-cartoon-10569
01/27/2021, 9:42 PMprehistoric-kite-30979
01/27/2021, 9:50 PMprehistoric-kite-30979
01/27/2021, 9:50 PMprehistoric-kite-30979
01/27/2021, 9:52 PMprehistoric-kite-30979
01/27/2021, 10:07 PMprehistoric-kite-30979
01/27/2021, 10:08 PMpulumi.runtime.registerStackTransformation((args) => {
console.log("TEST")
args.props["tags"] = { ...args.props["tags"], ...{
"pulumi:project": pulumi.getProject(),
"pulumi:stack": pulumi.getStack(),
} }
return { props: args.props, opts: args.opts }
})
little-cartoon-10569
01/27/2021, 10:08 PMprehistoric-kite-30979
01/27/2021, 10:09 PMprehistoric-kite-30979
01/27/2021, 10:09 PMlittle-cartoon-10569
01/27/2021, 10:10 PMprehistoric-kite-30979
01/27/2021, 10:10 PMlittle-cartoon-10569
01/27/2021, 10:13 PMlittle-cartoon-10569
01/27/2021, 10:15 PMfunction autoTagger(autoTags: any): ResourceTransformation {
return function (args: ResourceTransformationArgs) {
if (isTaggable(args.type) && (args.opts as any)["import"] == undefined) {
args.props.tags = {
Name: `${args.name}`, ...autoTags, ...args.props.tags,
};
return { props: args.props, opts: args.opts };
}
return undefined;
}
}
prehistoric-kite-30979
01/27/2021, 10:16 PMlittle-cartoon-10569
01/27/2021, 10:17 PMlittle-cartoon-10569
01/27/2021, 10:18 PMprehistoric-kite-30979
01/28/2021, 1:39 PM