airflow.providers.amazon.aws.hooks.sns

This module contains AWS SNS hook

Module Contents

class airflow.providers.amazon.aws.hooks.sns.AwsSnsHook(*args, **kwargs)[source]

Bases: airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook

Interact with Amazon Simple Notification Service.

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.

See also

AwsBaseHook

publish_to_target(self, target_arn: str, message: str, subject: Optional[str] = None, message_attributes: Optional[dict] = None)[source]

Publish a message to a topic or an endpoint.

Parameters
  • target_arn (str) -- either a TopicArn or an EndpointArn

  • message -- the default message you want to send

  • message -- str

  • subject (str) -- subject of message

  • message_attributes (dict) --

    additional attributes to publish for message filtering. This should be a flat dict; the DataType to be sent depends on the type of the value:

    • bytes = Binary

    • str = String

    • int, float = Number

    • iterable = String.Array

Was this entry helpful?