airflow.providers.amazon.aws.operators.sns

釋出訊息到 SNS 主題。

SnsPublishOperator

釋出訊息到 Amazon SNS。

模組內容

class airflow.providers.amazon.aws.operators.sns.SnsPublishOperator(*, target_arn, message, subject=None, message_attributes=None, **kwargs)[source]

基類: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.sns.SnsHook]

釋出訊息到 Amazon SNS。

參見

有關如何使用此 Operator 的更多資訊,請參閱指南:釋出訊息到現有的 SNS 主題

引數:
  • target_arn (str) – TopicArn 或 EndpointArn

  • message (str) – 要傳送的預設訊息(可模板化)

  • subject (str | None) – 要傳送的訊息主題(可模板化)

  • message_attributes (dict | None) – 要以平面字典形式傳送的訊息屬性(資料型別將自動確定)

  • aws_conn_id – 用於 AWS 憑據的 Airflow 連線。如果為 None 或空,則使用 boto3 預設行為。如果在分散式環境中執行 Airflow 並且 aws_conn_id 為 None 或空,則將使用 boto3 預設配置(並且必須在每個 worker 節點上維護此配置)。

  • region_name – AWS 區域名稱。如果未指定,則使用 boto3 預設行為。

  • verify – 是否驗證 SSL 證書。參見: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – 用於 botocore 客戶端的配置字典(鍵值對)。參見: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers[source]
target_arn[source]
message[source]
subject = None[source]
message_attributes = None[source]
execute(context)[source]

建立 operator 時派生。

Context 是用於渲染 Jinja 模板的同一字典。

有關更多上下文,請參閱 get_template_context。

此條目有幫助嗎?