airflow.providers.amazon.aws.operators.sqs

Publish message to SQS queue.

Module Contents

Classes

SqsPublishOperator

Publish a message to an Amazon SQS queue.

class airflow.providers.amazon.aws.operators.sqs.SqsPublishOperator(*, sqs_queue, message_content, message_attributes=None, delay_seconds=0, message_group_id=None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.sqs.SqsHook]

Publish a message to an Amazon SQS queue.

See also

For more information on how to use this operator, take a look at the guide: Publish a message to an Amazon SQS queue

Parameters
  • sqs_queue (str) – The SQS queue url (templated)

  • message_content (str) – The message content (templated)

  • message_attributes (dict | None) – additional attributes for the message (default: None) For details of the attributes parameter see botocore.client.SQS.send_message()

  • delay_seconds (int) – message delay (templated) (default: 1 second)

  • message_group_id (str | None) – This parameter applies only to FIFO (first-in-first-out) queues. (default: None) For details of the attributes parameter see botocore.client.SQS.send_message()

  • aws_conn_id – The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).

  • region_name – AWS region_name. If not specified then the default boto3 behaviour is used.

  • verify – Whether or not to verify SSL certificates. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – Configuration dictionary (key-values) for botocore client. See: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: Sequence[str][source]
template_fields_renderers[source]
ui_color = '#6ad3fa'[source]
execute(context)[source]

Publish the message to the Amazon SQS queue.

Parameters

context (airflow.utils.context.Context) – the context object

Returns

dict with information about the message sent For details of the returned dict see botocore.client.SQS.send_message()

Return type

dict

Was this entry helpful?