Categories:

User & Security DDL (Third-Party Service Integrations)

CREATE NOTIFICATION INTEGRATION

Creates a new notification integration in the account or replaces an existing integration. A notification integration is a Snowflake object that provides an interface between Snowflake and third-party messaging services (third-party cloud message queuing services, email services, etc.).

See also:

ALTER NOTIFICATION INTEGRATION , DROP INTEGRATION , SHOW INTEGRATIONS

In this Topic:

Features

Notification integrations are integral to the following features per cloud storage service and email service:

Amazon Web Services (AWS)

Push notifications:

Email notifications:

Google Cloud (GCP)

Automated data loads or metadata refreshes:

Push notifications:

Microsoft Azure (Azure)

Automated data loads or metadata refreshes:

Push notifications:

Syntax

Automated data loads or metadata refreshes

CREATE [ OR REPLACE ] NOTIFICATION INTEGRATION [IF NOT EXISTS]
  <name>
  ENABLED = { TRUE | FALSE }
  TYPE = QUEUE
  cloudProviderParamsAuto
  [ COMMENT = '<string_literal>' ]

Where:

cloudProviderParamsAuto (for Google Cloud Storage) ::=
  NOTIFICATION_PROVIDER = GCP_PUBSUB
  GCP_PUBSUB_SUBSCRIPTION_NAME = '<subscription_id>'
cloudProviderParamsAuto (for Microsoft Azure Storage) ::=
  NOTIFICATION_PROVIDER = AZURE_EVENT_GRID
  AZURE_STORAGE_QUEUE_PRIMARY_URI = '<queue_URL>'
  AZURE_TENANT_ID = '<directory_ID>';

Push notifications

CREATE [ OR REPLACE ] NOTIFICATION INTEGRATION [IF NOT EXISTS]
  <name>
  ENABLED = { TRUE | FALSE }
  DIRECTION = OUTBOUND
  TYPE = QUEUE
  cloudProviderParamsPush
  [ COMMENT = '<string_literal>' ]

Where:

cloudProviderParamsPush (for Amazon SNS) ::=

  NOTIFICATION_PROVIDER = AWS_SNS
  AWS_SNS_TOPIC_ARN = '<topic_arn>'
  AWS_SNS_ROLE_ARN = '<iam_role_arn>'
cloudProviderParamsPush (for Google Pub/Sub) ::=
  NOTIFICATION_PROVIDER = GCP_PUBSUB
  GCP_PUBSUB_TOPIC_NAME = '<topic_id>'
cloudProviderParamsPush (for Microsoft Azure Event Grid) ::=
  NOTIFICATION_PROVIDER = AZURE_EVENT_GRID
  AZURE_EVENT_GRID_TOPIC_ENDPOINT = '<event_grid_topic_endpoint>'
  AZURE_TENANT_ID = '<directory_ID>';

Email notifications

CREATE [ OR REPLACE ] NOTIFICATION INTEGRATION [IF NOT EXISTS]
  <name>
  TYPE = EMAIL
  ENABLED = { TRUE | FALSE }
  ALLOWED_RECIPIENTS = ( '<email_address_1>' [ , ... '<email_address_N>' ] )
  [ COMMENT = '<string_literal>' ]

Required Parameters

name

String that specifies the identifier (i.e. name) for the integration; must be unique in your account.

In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier Requirements.

ENABLED = { TRUE | FALSE }

Specifies whether to initiate operation of the integration or suspend it.

  • TRUE enables the integration.

  • FALSE disables the integration for maintenance. Any integration between Snowflake and a third-party service fails to work.

TYPE = QUEUE | EMAIL

Specify the type of integration:

  • QUEUE: Creates an interface between Snowflake and a third-party cloud message queuing service.

  • EMAIL: Creates an interface between Snowflake and a third-party email service.

    You can define a maximum of 10 email notification integrations for a given account.

Optional Parameters

DIRECTION = OUTBOUND

(For push notifications using TYPE = QUEUE) Direction of the cloud messaging with respect to Snowflake. Required only when configuring push notifications to a cloud messaging service.

OUTBOUND: Specifies that Snowflake produces the notification sent to the cloud messaging service.

ALLOWED_RECIPIENTS=('email_address_1' [, ... 'email_address_N'])

(For TYPE = EMAIL) A comma-separated list of quoted email addresses that can receive notification emails from this integration.

These must be email addresses of users in the current account. These email addresses must be verified.

The maximum number of email addresses that you can specify is 50.

COMMENT = 'string_literal'

String (literal) that specifies a comment for the integration.

Default: No value

Cloud Provider Parameters for Automated Data Loads or Metadata Refreshes (cloudProviderParamsAuto)

Google Cloud Storage

NOTIFICATION_PROVIDER = GCP_PUBSUB

Specifies Google Cloud Pub/Sub as the third-party cloud message queuing service.

GCP_PUBSUB_SUBSCRIPTION_NAME = '<subscription_id>'

Pub/Sub topic subscription ID used to allow Snowflake access to event messages.

Note

A single notification integration supports a single Google Cloud Pub/Sub subscription. Referencing the same Pub/Sub subscription in multiple notification integrations can result in missing data in target tables because event notifications are split between notification integrations.

Microsoft Azure Storage

NOTIFICATION_PROVIDER = AZURE_EVENT_GRID

Specifies Microsoft Azure Event Grid as the third-party cloud message queuing service.

AZURE_STORAGE_QUEUE_PRIMARY_URI = 'https://storage_queue_account.queue.core.windows.net/storage_queue_name'

Specifies the queue ID for the Azure Queue Storage queue created for Event Grid notifications.

Note

A single notification integration supports a single Azure Storage queue. Referencing the same storage queue in multiple notification integrations can result in missing data in target tables because event notifications are split between notification integrations.

AZURE_TENANT_ID = 'ad_directory_id'

Specifies the ID of the Azure Active Directory tenant used for identity management. This ID is needed to generate the consent URL that grants Snowflake access to the Event Grid notification subscription.

Cloud Provider Parameters for Push Notifications (cloudProviderParamsPush)

Amazon Simple Notification Service

NOTIFICATION_PROVIDER = AWS_SNS

Specifies Amazon Simple Notification Service (SNS) as the third-party cloud message queuing service.

AWS_SNS_TOPIC_ARN = '<topic_arn>'

Amazon Resource Name (ARN) of the Amazon SNS (SNS) topic to which notifications are pushed.

AWS_SNS_ROLE_ARN = '<iam_role_arn>'

ARN of the IAM role that has permissions to publish messages to the SNS topic.

Google Pub/Sub

NOTIFICATION_PROVIDER = GCP_PUBSUB

Specifies Google Cloud Pub/Sub as the third-party cloud message queuing service.

GCP_PUBSUB_TOPIC_NAME = '<topic_id>'

Identification of the Pub/Sub topic to which Snowpipe pushes notifications.

Microsoft Azure Event Grid

NOTIFICATION_PROVIDER = AZURE_EVENT_GRID

Specifies Microsoft Azure Event Grid as the third-party cloud message queuing service.

AZURE_EVENT_GRID_TOPIC_ENDPOINT = '<event_grid_topic_endpoint>'

Event Grid topic endpoint to which Snowpipe pushes notifications.

AZURE_TENANT_ID = 'ad_directory_id'

ID of the Azure Active Directory tenant used for identity management. This ID is needed to generate the consent URL that grants Snowflake access to the Event Grid topic.

Access Control Requirements

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE INTEGRATION

Account

Only the ACCOUNTADMIN role has this privilege by default. The privilege can be granted to additional roles as needed.

For instructions on creating a custom role with a specified set of privileges, see Creating Custom Roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Access Control in Snowflake.

Usage Notes

  • Creating a single notification integration for multiple Microsoft Azure Storage queues or Google Cloud Pub/Sub subscriptions is not supported.

  • Using the same Microsoft Azure Storage queue or Google Cloud Pub/Sub subscription for multiple notification integrations is not supported.

  • Regarding metadata:

    Attention

    Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata Fields in Snowflake.

  • CREATE OR REPLACE <object> statements are atomic. That is, when the object is replaced, the old object deletion and the new object creation are processed in a single transaction.

Examples

For examples specific to Snowflake features, see the topics referenced in Features (in this topic).

Back to top