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".No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by