Skip to content

AWS.Notifications reference

Source: src/AWS/Notifications/ChannelAssociation.ts

An AWS User Notifications channel association — attaches a delivery channel (an email contact, an Amazon Q Developer chat channel, or a Console Mobile Application device) to a NotificationConfiguration, so matching events are actually delivered somewhere beyond the Console notification center.

The association is existence-only (there is nothing mutable): changing either ARN replaces it.

import * as Notifications from "alchemy/AWS/Notifications";
import * as NotificationsContacts from "alchemy/AWS/NotificationsContacts";
const config = yield* Notifications.NotificationConfiguration("Alerts", {
description: "Deployment alerts",
});
const contact = yield* NotificationsContacts.EmailContact("OnCall", {
emailAddress: "oncall@example.com",
});
const association = yield* Notifications.ChannelAssociation("OnCallEmail", {
notificationConfigurationArn: config.notificationConfigurationArn,
channelArn: contact.emailContactArn,
});

Source: src/AWS/Notifications/EventRule.ts

An AWS User Notifications event rule — attaches an EventBridge source/event-type (optionally narrowed by an event pattern) to a NotificationConfiguration, across one or more regions.

source, eventType and the parent configuration are immutable (changing them replaces the rule); eventPattern and regions update in place. User Notifications materializes a managed EventBridge rule in every listed region.

Notify on S3 object creation

import * as Notifications from "alchemy/AWS/Notifications";
const config = yield* Notifications.NotificationConfiguration("Alerts");
const rule = yield* Notifications.EventRule("S3Created", {
notificationConfigurationArn: config.notificationConfigurationArn,
source: "aws.s3",
eventType: "Object Created",
regions: ["us-west-2"],
});

Restrict matches with an event pattern

const rule = yield* Notifications.EventRule("BucketRule", {
notificationConfigurationArn: config.notificationConfigurationArn,
source: "aws.s3",
eventType: "Object Created",
eventPattern: { detail: { bucket: { name: ["my-bucket"] } } },
regions: ["us-west-2", "us-east-2"],
});

Source: src/AWS/Notifications/GetManagedNotificationChildEvent.ts

Runtime binding for notifications:GetManagedNotificationChildEvent.

Fetch one child event of an aggregated AWS-managed notification (e.g. a single account/region item inside an aggregate AWS Health event) by its ARN. Provide the implementation with Effect.provide(AWS.Notifications.GetManagedNotificationChildEventHttp).

GetManagedNotificationChildEvent: Reading AWS-Managed Notifications

Section titled “GetManagedNotificationChildEvent: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const getManagedNotificationChildEvent =
yield* AWS.Notifications.GetManagedNotificationChildEvent();
// runtime
const child = yield* getManagedNotificationChildEvent({ arn: childArn });

Source: src/AWS/Notifications/GetManagedNotificationConfiguration.ts

Runtime binding for notifications:GetManagedNotificationConfiguration.

Fetch one AWS-managed notification configuration (the AWS Health Security/Operations/Issue/Billing categories) by its ARN. Provide the implementation with Effect.provide(AWS.Notifications.GetManagedNotificationConfigurationHttp).

GetManagedNotificationConfiguration: Reading AWS-Managed Notifications

Section titled “GetManagedNotificationConfiguration: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const getManagedNotificationConfiguration =
yield* AWS.Notifications.GetManagedNotificationConfiguration();
// runtime
const config = yield* getManagedNotificationConfiguration({
arn: managedConfigArn,
});

Source: src/AWS/Notifications/GetManagedNotificationEvent.ts

Runtime binding for notifications:GetManagedNotificationEvent.

Fetch one AWS-managed notification event (AWS Health security, operations, billing and issue notifications) by its ARN. Provide the implementation with Effect.provide(AWS.Notifications.GetManagedNotificationEventHttp).

GetManagedNotificationEvent: Reading AWS-Managed Notifications

Section titled “GetManagedNotificationEvent: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const getManagedNotificationEvent =
yield* AWS.Notifications.GetManagedNotificationEvent();
// runtime
const event = yield* getManagedNotificationEvent({ arn: eventArn });
const headline = event.content.messageComponents.headline;

Source: src/AWS/Notifications/GetNotificationEvent.ts

Runtime binding for notifications:GetNotificationEvent.

Fetch one notification event (headline, message components, source event metadata) by its ARN. Provide the implementation with Effect.provide(AWS.Notifications.GetNotificationEventHttp).

GetNotificationEvent: Reading Notification Events

Section titled “GetNotificationEvent: Reading Notification Events”
// init — account-level binding takes no resource
const getNotificationEvent = yield* AWS.Notifications.GetNotificationEvent();
// runtime
const event = yield* getNotificationEvent({ arn: eventArn });
const headline = event.content.messageComponents.headline;

Source: src/AWS/Notifications/ListChannels.ts

Runtime binding for notifications:ListChannels.

List the delivery channel ARNs associated with a notification configuration. Provide the implementation with Effect.provide(AWS.Notifications.ListChannelsHttp).

ListChannels: Reading Configuration Channels

Section titled “ListChannels: Reading Configuration Channels”
// init — bind the operation to the configuration
const listChannels = yield* AWS.Notifications.ListChannels(config);
// runtime
const result = yield* listChannels();
const channelArns = result.channels;

ListManagedNotificationChannelAssociations

Section titled “ListManagedNotificationChannelAssociations”

Source: src/AWS/Notifications/ListManagedNotificationChannelAssociations.ts

Runtime binding for notifications:ListManagedNotificationChannelAssociations.

List the account contacts and channels associated with an AWS-managed notification configuration. Provide the implementation with Effect.provide(AWS.Notifications.ListManagedNotificationChannelAssociationsHttp).

ListManagedNotificationChannelAssociations: Reading AWS-Managed Notifications

Section titled “ListManagedNotificationChannelAssociations: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const listManagedNotificationChannelAssociations =
yield* AWS.Notifications.ListManagedNotificationChannelAssociations();
// runtime
const result = yield* listManagedNotificationChannelAssociations({
managedNotificationConfigurationArn: managedConfigArn,
});
const channels = result.channelAssociations;

Source: src/AWS/Notifications/ListManagedNotificationChildEvents.ts

Runtime binding for notifications:ListManagedNotificationChildEvents.

List the child events of one aggregated AWS-managed notification event. Provide the implementation with Effect.provide(AWS.Notifications.ListManagedNotificationChildEventsHttp).

ListManagedNotificationChildEvents: Reading AWS-Managed Notifications

Section titled “ListManagedNotificationChildEvents: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const listManagedNotificationChildEvents =
yield* AWS.Notifications.ListManagedNotificationChildEvents();
// runtime
const result = yield* listManagedNotificationChildEvents({
aggregateManagedNotificationEventArn: aggregateArn,
});
const children = result.managedNotificationChildEvents;

Source: src/AWS/Notifications/ListManagedNotificationConfigurations.ts

Runtime binding for notifications:ListManagedNotificationConfigurations.

List the AWS-managed notification configurations (the AWS Health Security/Operations/Issue/Billing categories), optionally filtered by an associated channel. Provide the implementation with Effect.provide(AWS.Notifications.ListManagedNotificationConfigurationsHttp).

ListManagedNotificationConfigurations: Reading AWS-Managed Notifications

Section titled “ListManagedNotificationConfigurations: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const listManagedNotificationConfigurations =
yield* AWS.Notifications.ListManagedNotificationConfigurations();
// runtime
const result = yield* listManagedNotificationConfigurations();
const names = result.managedNotificationConfigurations.map((c) => c.name);

Source: src/AWS/Notifications/ListManagedNotificationEvents.ts

Runtime binding for notifications:ListManagedNotificationEvents.

List the account’s AWS-managed notification events (AWS Health security, operations, billing and issue notifications), optionally filtered by time range, source, or related account. Provide the implementation with Effect.provide(AWS.Notifications.ListManagedNotificationEventsHttp).

ListManagedNotificationEvents: Reading AWS-Managed Notifications

Section titled “ListManagedNotificationEvents: Reading AWS-Managed Notifications”
// init — account-level binding takes no resource
const listManagedNotificationEvents =
yield* AWS.Notifications.ListManagedNotificationEvents();
// runtime
const result = yield* listManagedNotificationEvents({
startTime: new Date(Date.now() - 7 * 24 * 3600 * 1000),
});
const count = result.managedNotificationEvents.length;

Source: src/AWS/Notifications/ListNotificationEvents.ts

Runtime binding for notifications:ListNotificationEvents.

List the account’s notification events, optionally filtered by time range, EventBridge source, or aggregate parent event. Provide the implementation with Effect.provide(AWS.Notifications.ListNotificationEventsHttp).

ListNotificationEvents: Reading Notification Events

Section titled “ListNotificationEvents: Reading Notification Events”
// init — account-level binding takes no resource
const listNotificationEvents = yield* AWS.Notifications.ListNotificationEvents();
// runtime
const result = yield* listNotificationEvents({ source: "aws.s3" });
const headlines = result.notificationEvents.map(
(e) => e.notificationEvent.messageComponents.headline,
);

Source: src/AWS/Notifications/NotificationConfiguration.ts

An AWS User Notifications notification configuration — the container that groups EventRules (which events to notify on) and delivery channels (where notifications go: Console bell, email contacts, chat).

User Notifications is a global service managed from us-east-1; the provider pins the control-plane region automatically, so the resource works from a stack deployed in any region.

NotificationConfiguration: Creating a Notification Configuration

Section titled “NotificationConfiguration: Creating a Notification Configuration”

Basic configuration

import * as Notifications from "alchemy/AWS/Notifications";
const config = yield* Notifications.NotificationConfiguration("Alerts", {
description: "Deployment alerts",
});

Aggregate duplicate events for 5 minutes

const config = yield* Notifications.NotificationConfiguration("Alerts", {
description: "Deployment alerts",
aggregationDuration: "SHORT",
tags: { team: "platform" },
});

NotificationConfiguration: Adding Event Rules

Section titled “NotificationConfiguration: Adding Event Rules”
const rule = yield* Notifications.EventRule("AlarmRule", {
notificationConfigurationArn: config.notificationConfigurationArn,
source: "aws.cloudwatch",
eventType: "CloudWatch Alarm State Change",
regions: ["us-west-2"],
});

Source: src/AWS/Notifications/NotificationHub.ts

An AWS User Notifications notification hub — a regional enablement that stores and replicates notification events. An account can register at most 3 hubs, and at least one ACTIVE hub must exist for notification configurations to deliver events.

Registration is a true upsert keyed by region (re-registering an existing hub region is a no-op), so the hub behaves like a per-region singleton.

AWS refuses to deregister the last ACTIVE hub in the account (ConflictException). Destroying a stack containing the account’s only hub therefore fails — keep a baseline hub registered outside the stack, or register a second hub first.

NotificationHub: Registering a Notification Hub

Section titled “NotificationHub: Registering a Notification Hub”
import * as Notifications from "alchemy/AWS/Notifications";
const hub = yield* Notifications.NotificationHub("Hub", {
region: "us-east-2",
});