Amazon Simple Notification Service (SNS) Operators¶
Amazon Simple Notification Service (Amazon SNS) is a managed service that provides message delivery from publishers to subscribers (also known as producers and consumers). Publishers communicate asynchronously with subscribers by sending messages to a topic, which is a logical access point and communication channel. Clients can subscribe to the SNS topic and receive published messages using a supported endpoint type, such as Amazon Kinesis Data Firehose, Amazon SQS, AWS Lambda, HTTP, email, mobile push notifications, and mobile text messages (SMS).
Airflow provides an operator to publish messages to an SNS Topic.
Prerequisite Tasks¶
Publish A Message To An Existing SNS Topic¶
To publish a message to an Amazon SNS Topic you can use
SnsPublishOperator
.
publish = SnsPublishOperator(
task_id='publish_message',
target_arn=SNS_TOPIC_ARN,
message='This is a sample message sent to SNS via an Apache Airflow DAG task.',
)