purple-printer-9748
11/06/2023, 6:25 PMconst notificationEmails: string[] = config.requireObject<string[]>("notificationEmails")
let destinationIds: any[] = [];
// building destinations IDs from email list:
notificationEmails.map((email: string) => {
const alertDest = new newrelic.NotificationDestination(`${client}-alertDest-${email}`, {
name: getNameWithConvention(`Alert ${email}`),
type: 'EMAIL',
active: true,
properties: [
{
key: 'email',
value: email,
},
],
});
const alertChannel = new newrelic.NotificationChannel(`${client}-alertChannel-${email}`, {
name: getNameWithConvention(`Alert channel`),
destinationId: alertDest.id,
product: "IINT",
properties: [
],
type: "EMAIL",
});
destinationIds.push({
channelId: alertChannel.id,
});
})
const alertNotificationWorkflow = new newrelic.Workflow("alertNotificationWorkflow", {
name: `[${client}] Notification workflow`,
mutingRulesHandling: "NOTIFY_ALL_ISSUES",
issuesFilter: {
name: "Filter-name",
type: "FILTER",
predicates: [{
attribute: "labels.policyIds",
operator: "EXACTLY_MATCHES",
values: [
alertPolicy.id
],
}],
},
destinations: destinationIds,
});
And it always writes:
Previewing update (dev):
Type Name Plan Info
pulumi:pulumi:Stack pulumi-newrelic-dev
~ └─ newrelic:index:Workflow alertNotificationWorkflow update [diff: ~destinations]
Of course running pulumi up is not helping, because after that it is still the same.dry-keyboard-94795
11/06/2023, 6:55 PM--diff
to get a more detailed view of what's changing.
As for updating who gets emailed, I tend to setup mailing lists/groups for notifications, and manage the individuals on the group itself. Google Groups works nicely for thispurple-printer-9748
11/06/2023, 7:01 PM~ destinations: [
~ [0]: {
~ channelId: "ID1" => "ID2"
}
~ [1]: {
~ channelId: "ID2" => "ID1"
}
]
and it's always the same, after pulumi up, it saves, changes acording to that diff, but than change is not detected and diff is the same.
Anyways - I like your idea with mailing groups, but I would need to manage mailing groups with pulumi as well ..., will need to dig into this, but it's interesting, Thanksdry-keyboard-94795
11/06/2023, 7:14 PMpurple-printer-9748
11/06/2023, 7:22 PM