Skip to main content
Amazon Simple Notification Service, also written as Amazon SNS or AWS SNS, pushes to devices subscribed to an SNS topic or target ARN. Its Courier provider key is aws-sns.
Amazon SNS also works as an SMS provider. See .

Prerequisites

Setup

1

Create an AWS access key

In AWS, create an IAM user with SNS publish permission and copy its access key ID and secret access key.
2

Configure in Courier

Open the in Courier, enter your Access Key ID and Secret Access Key, choose your region, then click “Complete.”
You only add the integration once. It is then available as a provider on both the push and SMS channels.
Leave Topic ARN empty to push to individual devices. A saved Topic ARN outranks the Target ARN on a recipient’s profile, so every push goes to the topic instead. See Destination precedence.

Profile requirements

Device tokens live on the user profile rather than on the send, so one profile can hold tokens for several devices and every push provider reads them from the same place. covers the model. SNS addresses the device by the Target ARN it is subscribed to, nested under aws_sns on the profile. Store it once with , which merges into the profile and creates it if it does not exist:
To use a Topic ARN instead, set it on the integration or pass it as a config override. It is not read from the recipient profile.

Destination precedence

Courier picks exactly one SNS destination per message, in this order:
  1. phone_number on the profile, which sends an SMS rather than a push
  2. Topic ARN, from the integration config or a config override
  3. aws_sns.target_arn on the profile
The first one present wins and the rest are discarded. Nothing is sent if none of the three is set. Then send to user_id and Courier resolves the address. For a one-off with no stored profile, pass it inline instead: "to": { "aws_sns": { "target_arn": "your:target:arn" } }.

Send by user id

The call in every language, and the rest of the profile object.

Send to a recipient

Courier reads aws_sns off the saved profile, so preferences apply and the value can change without touching this code.

Overrides

covers the two levels and which one wins. lists the fields every push provider takes. The config override swaps credentials, region, or the Topic ARN at send time:
The body override merges into the SNS Publish request itself, so its fields use the AWS parameter names rather than Courier’s. See the SNS publish properties.

Provider details

Courier recommends routing to the channel. Naming this key in routing.channels instead is supported, and sends through just this provider.

Send to a specific provider

When that is worth doing, and what you give up: failover, channel priority, and providers you add later.