AWS SQS


The aws_sqs notification platform enables publishing to an AWS SQS message queue.

Setup

For more information, please read the AWS General Reference regarding Security Credentials to get the needed details. Also, check the boto3 Documentation about the profiles and the AWS Regions and Endpoints Reference for available regions.

Configuration

To use this notification platform in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
notify:
  - name: NOTIFIER_NAME
    platform: aws_sqs
    aws_access_key_id: AWS_ACCESS_KEY_ID
    aws_secret_access_key: AWS_SECRET_ACCESS_KEY
    region_name: 'us-east-1'

Configuration variables:

  • aws_access_key_id (Required if aws_secret_access_key is provided): Your AWS Access Key ID. If provided, you must also provide an aws_secret_access_key and must not provide a profile_name.
  • aws_secret_access_key (Required if aws_access_key_id is provided): Your AWS Secret Access Key. If provided, you must also provide an aws_access_key_id and must not provide a profile_name.
  • profile_name (Optional): A credentials profile name.
  • region_name (Required): The region identifier to connect to. The default is us-east-1.
  • name (Optional): Setting the optional parameter name allows multiple notifiers to be created. The default value is notify. The notifier will bind to the service notify.NOTIFIER_NAME.

Usage

AWS SQS is a notify platform and thus can be controlled by calling the notify service as described here. It will publish a message to the queue for all targets given in the notification payload. A target must be a SQS topic URL. For more information, please see the SQS docs.

The SQS event payload will contain everything passed in the service call payload. SQS payloads will be published as stringified JSON. All attributes from the payload except message will also be sent as stringified message attributes. Here is an example message that would be published to the SQS queue:

{
  "title": "Test message!",
  "target": "http://sqs.us-east-1.amazonaws.com/123456789012/queue2",
  "data": {
    "test": "okay"
  },
  "message": "Hello world!"
}