Skip to content
GitHubXDiscord

ContactChannel

The ContactChannel resource allows you to manage AWS SSMContacts ContactChannels for notifying users through various communication methods.

Create a basic contact channel with required properties:

import AWS from "alchemy/aws/control";
const basicContactChannel = await AWS.SSMContacts.ContactChannel("basicContactChannel", {
ChannelName: "EmailNotification",
ChannelAddress: "user@example.com",
ContactId: "12345678-1234-1234-1234-1234567890ab",
ChannelType: "EMAIL",
DeferActivation: false // Optional: Set to true to defer activation
});

Configure a contact channel with defer activation to manage when the channel becomes active:

const advancedContactChannel = await AWS.SSMContacts.ContactChannel("advancedContactChannel", {
ChannelName: "SMSNotification",
ChannelAddress: "+15555551234",
ContactId: "12345678-1234-1234-1234-1234567890ab",
ChannelType: "SMS",
DeferActivation: true, // Optional: Defer activation until explicitly activated
adopt: true // Optional: Adopt existing resource if it already exists
});

Set up a contact channel for a user that will be used for incident notifications:

const incidentNotificationChannel = await AWS.SSMContacts.ContactChannel("incidentNotificationChannel", {
ChannelName: "IncidentAlerts",
ChannelAddress: "alertuser@example.com",
ContactId: "12345678-1234-1234-1234-1234567890cd",
ChannelType: "EMAIL",
DeferActivation: false // Set to false for immediate activation
});