jolly-ram-74400
08/09/2024, 6:39 PMlet tags: { [key: string]: string } = {
foo: "abc",
bar: "def"
}
const existingRG = azure.resources.getResourceGroup({ resourceGroupName: args.rgName }, options)
const combinedTags = existingRG.then(t => {
const existingTags = t.tags || {}
Object.keys(tags).forEach(k => {
existingTags[k] = tags[k]
})
return existingTags
}).catch(e => {
console.warn(`Failed to retrieve resource group: ${e.message}.`);
return tags
})
I tried setting ignoreChanges to "tags", but that would disable "drift-detection" on the important tags configured by pulumi.
Is there a simpler way to achieve this?
I also have the problem that removing tags is not that easy and needs additional logic. Unfortunatly I did not found a way to access the state(stack-state) that was applied to azure during the last "pulumi up".