> For the complete documentation index, see [llms.txt](https://docs.onum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onum.com/data-sinks/data-sink-integrations/send-data-to-amazon-sqs.md).

# Send data to Amazon SQS

{% hint style="info" %}
See the changelog of the **Amazon SQS** Data Sink [here](/data-sinks-changelog/amazon-sqs-data-sink.md).
{% endhint %}

## Overview

The following article outlines a basic data flow from Onum to [Amazon SQS](https://aws.amazon.com/sqs/).

Amazon SQS (Simple Queue Service) is a fully managed message queuing service that enables asynchronous communication between different parts of a distributed system. It allows developers to send, store, and retrieve messages without needing to manage the underlying queue infrastructure.

## Prerequisites

You will need an **IAM** User, role or group with the correct permissions to access and manage SQS.&#x20;

## Amazon SQS Setup&#x20;

**Go to IAM (Identity and Access Management)** to manage users, groups, roles and permissions.&#x20;

Under **Permissions Policies**, make sure you have assigned the policy `AmazonSQSFullAccess` to give full access to SQS resources. Alternatively, if you have custom permissions, go to **Policies - Create Policy** and in the **JSON** tab, paste your custom JSON e.g.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "sqs:CreateQueue",
        "sqs:GetQueueAttributes",
        "sqs:SendMessage"
      ],
      "Resource": "*"
    }
  ]
}
```

Download the **Access Key ID** and **Secret Access Key** — you’ll need these later.

## Onum setup

{% stepper %}
{% step %}
Log in to your Onum tenant and click **Data Sinks > New Data sink**.
{% endstep %}

{% step %}
Double-click the **Amazon SQS** Data Sink.
{% endstep %}

{% step %}
Enter a **Name** for the new Data Sink. Optionally, add a **Description** and some **Tags** to identify the Data Sink.
{% endstep %}

{% step %}
Decide whether or not to include this Data Sink info in the metrics and graphs of the [**Home**](/home.md) area.
{% endstep %}

{% step %}
In the **AWS authentication** section, choose the **Region** of your AWS console, found in your **General purpose buckets** area, next to the name.
{% endstep %}

{% step %}
Select the **Access Key ID** from your [Secrets](broken://pages/SNC8zGVDtIAIFa5E19n5) or click **New secret** to generate a new one.&#x20;

The **Access Key ID** is found in the **IAM Dashboard** of the **AWS Management Console**.

1. In the left panel, click on **Users**.
2. Select your **IAM user**.
3. Under the **Security Credentials** tab, scroll to **Access Keys**, and you will find existing **Access Key IDs** (but not the secret access key).
   {% endstep %}

{% step %}
Select the **Secret Access Key** from your [Secrets](broken://pages/SNC8zGVDtIAIFa5E19n5) or click **New secret** to generate a new one.

Under **Access keys**, you can see your **Access Key IDs**, but AWS **will not show the Secret Access Key**. You must have it saved somewhere. If you don't have the secret key saved, you need to create a new one.

{% hint style="info" %}
Learn more about secrets in Onum in [this article](/settings/organization-settings/secrets-management.md).
{% endhint %}
{% endstep %}

{% step %}
In the **Advanced configuration** section, set the **Bulk configuration** parameter to **true** if you want to allow bulk sending. Configure the following parameters:

* **Event time limit** - Time in seconds to wait before sending the batch. The default value is `1`, and the minimum is `0`.
* **Trigger conditions**
  * **Number of events** - Maximum number of events to send in a single batch. The maximum and default value is `10`.
  * **Event size** - Maximum limit of the batch size in bytes. The maximum and default value is `262144`. The minimum value is `1`.
    {% endstep %}

{% step %}
In the **Other configuration** section:

* If you have non-default URL that directs API requests to a specific Kinesis service endpoint, enter it here in the **Custom endpoint**.
* Specify **Delay seconds** length of time, in seconds, for which to delay a specific message. The minimum value is `1` and the maximum value is `900`.
  {% endstep %}

{% step %}
Click **Finish** when complete. Your new Data Sink will appear in the **Data sinks** area list.
{% endstep %}
{% endstepper %}

## Pipeline configuration

When it comes to using this Data sink in a [Pipeline](/pipelines.md), you must configure the following output parameters. To do it, simply click the Data sink on the canvas and select **Configuration**.

### Output configuration

<table><thead><tr><th width="147.62890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Message</strong></td><td>Select the field that contains the message. The data type must be <code>string</code>.</td></tr></tbody></table>

#### Queue configuration

<table><thead><tr><th width="147.62890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Standard</strong></td><td><p><strong>Queue name</strong>: The URL of your existing Amazon SQS queue to send the data to. To get it:</p><p></p><ol><li><strong>Go to the</strong> AWS Management Console.</li><li>In the <strong>Search Bar</strong>, type <code>SQS</code> and click on <strong>Simple Queue Service (SQS)</strong>.</li><li>Click on <strong>Queues</strong> in the left panel.</li><li>Locate your queue from the list and click it. </li><li>The <strong>Queue URL</strong> will be displayed in the table under <strong>URL</strong>.</li></ol><p>This is the correct format: <code>sqs.region.localhost/awsaccountnumber/storedinenvvar</code></p></td></tr><tr><td><strong>FIFO</strong></td><td><ol><li><p><strong>Queue name</strong>: The URL of your existing Amazon SQS queue to send the data to. To get it:</p><ol><li><strong>Go to the</strong> AWS Management Console.</li><li>In the <strong>Search Bar</strong>, type <code>SQS</code> and click on <strong>Simple Queue Service (SQS)</strong>.</li><li>Click on <strong>Queues</strong> in the left panel.</li><li>Locate your queue from the list and click it. </li><li><p>The <strong>Queue URL</strong> will be displayed in the table under <strong>URL</strong>.</p><p>This is the correct format: <code>sqs.region.localhost/awsaccountnumber/storedinenvvar</code></p></li></ol></li><li><strong>Message group ID</strong>: Select an incoming field to serve as the message group ID.</li><li><p><strong>Send message deduplication:</strong> Toggle <strong>ON</strong> to enable message deduplication and configure the following fields</p><ol><li><strong>InEventField:</strong> choose the incoming field for the message deduplication ID.</li><li><strong>Message content hash</strong>: when content-based deduplication is enabled, the message deduplication ID is optional.</li></ol></li></ol></td></tr></tbody></table>

Click **Save** to save your configuration.
