---
title: "AWS SNS | WebhookRelay"
meta:
  "og:description": "Subscribe to Amazon SNS topics and publish webhook data to SNS using Webhook Relay service connections."
  "og:title": "AWS SNS"
  description: "Subscribe to Amazon SNS topics and publish webhook data to SNS using Webhook Relay service connections."
---

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

Documentation

**Fundamentals**

# **AWS SNS**

Subscribe to Amazon SNS topics and publish webhook data to SNS using Webhook Relay service connections.

Connect Webhook Relay to **Amazon SNS** to subscribe to topics (input) or publish webhook data to topics (output).

## [Prerequisites](#prerequisites)

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

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

**For SNS Input (subscribe to topics):**

- `sns:Subscribe`
- `sns:GetTopicAttributes`
- `sqs:CreateQueue`
- `sqs:SetQueueAttributes`
- `sqs:ReceiveMessage`
- `sqs:DeleteMessage`
- `sqs:GetQueueUrl`

> SNS inputs require SQS permissions because Webhook Relay creates a dedicated SQS queue (`whr-sns-{input_id}`) and subscribes it to your SNS topic. Messages are then polled from this queue.

**For SNS Output (publish to topics):**

- `sns:Publish`
- `sns:GetTopicAttributes`

## [SNS Input — Subscribe to a Topic](#sns-input-subscribe-to-a-topic)

![Service Connection Input](https://webhookrelay.com/docs/service-connections/aws_sns/images/docs/sc/add_input.png)

SNS inputs subscribe to your SNS topic and relay every published message into your Webhook Relay bucket. Internally, a dedicated SQS queue is created and subscribed to the topic, then polled for messages.

### [Configuration](#configuration)

| Field | Required | Description |
| --- | :---: | --- |
| `topic_arn` | Yes | SNS Topic ARN (e.g. `arn:aws:sns:us-east-1:123456789:my-topic`) |
| `region` | No | AWS region — auto-extracted from the ARN |
| `subscription_arn` | Auto | Populated after the subscription is created |

**ARN format:** `arn:aws[-cn|-us-gov]:sns:<region>:<account-id>:<topic-name>`

## [SNS Output — Publish Webhooks to a Topic](#sns-output-publish-webhooks-to-a-topic)

SNS outputs publish incoming webhook data as messages to your SNS topic. This lets you fan out webhooks to all SNS subscribers (Lambda, SQS, email, HTTP endpoints, etc.).

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

| Field | Required | Description |
| --- | :---: | --- |
| `topic_arn` | Yes | SNS Topic ARN |
| `region` | No | AWS region — auto-extracted from the ARN |

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

Route messages from a GCP Pub/Sub subscription to your SNS topic — useful for triggering Lambda functions, sending notifications, or fanning out to multiple SQS queues:

1. Create a [GCP service connection](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections) with Pub/Sub subscriber permissions
2. Create an [AWS service connection](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections) with SNS publish permissions
3. Create a bucket in Webhook Relay
4. Add a **[GCP Pub/Sub](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections/gcp_pubsub) input** on the bucket (messages flow in)
5. Add an **AWS SNS output** on the bucket (messages published to the topic)

### [Transform the Message](#transform-the-message)

Use a [Function](https://webhookrelay.com/docs/service-connections/aws_sns/docs/webhooks/functions) to reshape the Pub/Sub message into a format your SNS subscribers expect:

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

// Create a message your SNS subscribers can process
const notification = {
    source: "gcp-pubsub",
    topic: pubsubMessage.subscription,
    data: pubsubMessage.data,
    attributes: pubsubMessage.attributes,
    timestamp: new Date().toISOString()
}

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

See the [JSON encoding](https://webhookrelay.com/docs/service-connections/aws_sns/docs/webhooks/functions/manipulating-json) and [HTTP requests](https://webhookrelay.com/docs/service-connections/aws_sns/docs/webhooks/functions/make-http-request) guides for more function examples.

## [Example: SNS to External HTTPS Webhook](#example-sns-to-external-https-webhook)

While SNS natively supports HTTP/HTTPS subscriptions, Webhook Relay adds capabilities on top:

- **Payload transformation** — reshape the SNS message before delivery using [Functions](https://webhookrelay.com/docs/service-connections/aws_sns/docs/webhooks/functions)
- **Authentication** — add [custom auth headers](https://webhookrelay.com/docs/service-connections/aws_sns/docs/webhooks/auth/username-password) to outgoing requests
- **Retry and logging** — full delivery logs with automatic retries
- **Multi-destination** — forward to multiple HTTPS endpoints, [SQS queues](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections/aws_sqs), [S3](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections/aws_s3), or GCP services simultaneously

1. Create an AWS service connection
2. Create a bucket with an **SNS input** pointing to your topic
3. Add one or more [public destinations](https://webhookrelay.com/docs/service-connections/aws_sns/docs/webhooks/public/public-destination)

## [Example: AWS SNS to GCP Pub/Sub](#example-aws-sns-to-gcp-pubsub)

Route SNS messages to a GCP Pub/Sub topic for cross-cloud event distribution:

1. Create an AWS service connection with SNS subscribe permissions
2. Create a [GCP service connection](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections) with Pub/Sub publisher permissions
3. Create a bucket with an **SNS input** and a **[GCP Pub/Sub](https://webhookrelay.com/docs/service-connections/aws_sns/docs/service-connections/gcp_pubsub) output**

Every message published to your SNS topic is automatically forwarded to the Pub/Sub topic, bridging AWS and GCP event systems.

Did this page help you?