NotificationChannel
Learn how to create, update, and manage AWS FMS NotificationChannels using Alchemy Cloud Control.
The NotificationChannel resource lets you manage AWS FMS NotificationChannels that are used to send notifications about AWS Firewall Manager policy violations.
Minimal Example
Section titled “Minimal Example”Create a basic notification channel with the required properties.
import AWS from "alchemy/aws/control";
const notificationChannel = await AWS.FMS.NotificationChannel("MyNotificationChannel", { SnsTopicArn: "arn:aws:sns:us-east-1:123456789012:MyTopic", SnsRoleName: "MyFmsRole"});
Advanced Configuration
Section titled “Advanced Configuration”If you want to adopt an existing notification channel without failing, you can set the adopt
property to true.
const adoptedChannel = await AWS.FMS.NotificationChannel("AdoptedNotificationChannel", { SnsTopicArn: "arn:aws:sns:us-east-1:123456789012:MyExistingTopic", SnsRoleName: "MyExistingFmsRole", adopt: true});
Updating Notification Channel
Section titled “Updating Notification Channel”You can update an existing notification channel to change its SNS topic or role name.
const updatedChannel = await AWS.FMS.NotificationChannel("UpdatedNotificationChannel", { SnsTopicArn: "arn:aws:sns:us-east-1:123456789012:UpdatedTopic", SnsRoleName: "UpdatedFmsRole"});
Auditing and Monitoring
Section titled “Auditing and Monitoring”To monitor changes to your notification channel, AWS automatically tracks the creation and last update times.
const channelDetails = await AWS.FMS.NotificationChannel("ChannelDetails", { SnsTopicArn: "arn:aws:sns:us-east-1:123456789012:MonitoringTopic", SnsRoleName: "MonitoringFmsRole"});
// Access the creation and last update timeconsole.log(`Channel Created At: ${channelDetails.CreationTime}`);console.log(`Last Updated At: ${channelDetails.LastUpdateTime}`);