---
title: "AWS SQS | WebhookRelay"
meta:
  "og:description": "Poll messages from Amazon SQS queues and send webhook data to SQS using Webhook Relay service connections."
  "og:title": "AWS SQS"
  description: "Poll messages from Amazon SQS queues and send webhook data to SQS using Webhook Relay service connections."
---

![Stripes](https://webhookrelay.com/docs/service-connections/aws_sqs/images/stripes.svg)

Documentation

**Fundamentals**

# **AWS SQS**

Poll messages from Amazon SQS queues and send webhook data to SQS using Webhook Relay service connections.

Connect Webhook Relay to **Amazon SQS** to poll messages from queues (input) or send webhook data as SQS messages (output).

## [Prerequisites](#prerequisites)

- An [AWS service connection](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/service-connections) with credentials that have SQS permissions
- An SQS queue in your AWS account

### [IAM Permissions](#iam-permissions)

**For SQS Input (poll messages):**

- `sqs:ReceiveMessage`
- `sqs:DeleteMessage`
- `sqs:GetQueueAttributes`

**For SQS Output (send messages):**

- `sqs:SendMessage`

## [SQS Input — Poll Messages from a Queue](#sqs-input-poll-messages-from-a-queue)

SQS inputs use long-polling (20-second wait, up to 10 messages per poll) to continuously receive messages from your queue. Messages are deleted from the queue after successful relay into your bucket.

### [Configuration](#configuration)

| Field | Required | Description |
| --- | :---: | --- |
| `queue_url` | Yes | Full SQS queue URL (e.g. `https://sqs.us-east-1.amazonaws.com/123456789/my-queue`) |
| `region` | No | AWS region — auto-extracted from the queue URL if not provided |

Once added, you can test it by using "Send and receive messages" button:

![SQS Input](https://webhookrelay.com/docs/service-connections/aws_sqs/images/docs/sc/sc_send_test_message.png)

## [SQS Output — Send Webhooks to a Queue](#sqs-output-send-webhooks-to-a-queue)

SQS outputs forward incoming webhook data as messages to your SQS queue. Every webhook that arrives in the bucket is sent as an SQS message.

### [Configuration](#configuration-1)

| Field | Required | Description |
| --- | :---: | --- |
| `queue_url` | Yes | Full SQS queue URL |
| `region` | No | AWS region — auto-extracted from the URL |

## [Example: Bridge GCP Pub/Sub to AWS SQS](#example-bridge-gcp-pubsub-to-aws-sqs)

Route messages from a GCP Pub/Sub subscription into an AWS SQS queue. This is ideal for cross-cloud event processing where your consumers read from SQS:

1. Create a [GCP service connection](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/service-connections) with Pub/Sub subscriber permissions
2. Create an [AWS service connection](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/service-connections) with SQS send permissions
3. Create a bucket in Webhook Relay
4. Add a **GCP Pub/Sub input** on the bucket
5. Add an **AWS SQS output** on the bucket

Messages published to the Pub/Sub topic are automatically delivered to your SQS queue.

### [Transform Between Formats](#transform-between-formats)

GCP Pub/Sub and AWS SQS use different message formats. Attach a [Function](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/webhooks/functions) to the bucket to reshape the payload. For example, convert a Pub/Sub message into a structured format for your SQS consumers:

```
const pubsubMessage = JSON.parse(r.body)

// Restructure for your SQS consumer
const sqsPayload = {
    source: "gcp-pubsub",
    topic: pubsubMessage.subscription,
    data: pubsubMessage.data,
    attributes: pubsubMessage.attributes,
    received_at: new Date().toISOString()
}

r.setBody(JSON.stringify(sqsPayload))
```

See the [JSON encoding](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/webhooks/functions/manipulating-json) guide for more payload transformation examples.

## [Example: SQS to HTTPS Webhook Delivery](#example-sqs-to-https-webhook-delivery)

Poll messages from an SQS queue and forward them to any HTTPS endpoint — useful when you want to process SQS messages with a service that only accepts webhooks:

1. Create an AWS service connection
2. Create a bucket with an **SQS input** pointing to your queue
3. Add a [public destination](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/webhooks/public/public-destination) as an output

You can also forward to [localhost](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/webhooks/internal/localhost) for local development, letting you consume SQS messages on your machine without deploying to AWS.

## [Example: Fan-Out from SQS to Multiple Destinations](#example-fan-out-from-sqs-to-multiple-destinations)

A single SQS input can feed multiple outputs on the same bucket. For example, forward SQS messages simultaneously to:

- A GCP Pub/Sub topic (cross-cloud replication)
- An [S3 bucket](https://webhookrelay.com/docs/service-connections/aws_sqs/docs/service-connections/aws_s3) (archival)
- An HTTPS API (real-time processing)

This lets you fan out messages without configuring multiple SQS consumers or SNS subscriptions.

Did this page help you?