Notification resources manage the delivery of Lagoon deployment events to external services. The workflow is two-step: first create a notification configuration, then link it to one or more projects using ProjectNotification.
NotificationSlack
A NotificationSlack configures a Slack incoming webhook as a notification channel.
A ProjectNotification links an existing notification configuration to a project. One notification can be linked to multiple projects, and one project can have multiple notifications.
Properties
Property
Type
Required
Description
projectName
string
Yes
Project name to attach the notification to
notificationType
string
Yes
Notification type: slack, rocketchat, email, or microsoftteams
notificationName
string
Yes
Name of the notification configuration to link
Outputs
Output
Type
Description
projectId
int
Lagoon internal ID of the linked project
Import
Import using the project name, notification type, and notification name:
Creating a Slack notification and linking it to a project
importpulumiimportpulumi_lagoonaslagoon# Create a Slack notification channel
slack_notif=lagoon.NotificationSlack("deployments-slack",lagoon.NotificationSlackArgs(name="deployments-slack",webhook="https://hooks.example.com/services/YOUR/SLACK/WEBHOOK",channel="#deployments",))# Create an email notification channel
email_notif=lagoon.NotificationEmail("ops-email",lagoon.NotificationEmailArgs(name="ops-email",email_address="ops@example.com",))# Link the Slack notification to the project
lagoon.ProjectNotification("my-site-slack",lagoon.ProjectNotificationArgs(project_name="my-site",notification_type="slack",notification_name="deployments-slack",),opts=pulumi.ResourceOptions(depends_on=[slack_notif]))# Link the email notification to the same project
lagoon.ProjectNotification("my-site-email",lagoon.ProjectNotificationArgs(project_name="my-site",notification_type="email",notification_name="ops-email",),opts=pulumi.ResourceOptions(depends_on=[email_notif]))