Skip to main content

AWS SNS

Adding the AWS SNS Integration

The AWS SNS provider is currently listed as a Push integration, although it can handle push, SMS, and email notifications. When adding it to your workflow in the designer, you can follow one of the two paths to add the integration:

  1. Add AWS SNS as a channel provider: Click "Add Channel" and select the Push channel. A Push option will be added to the left menu under "Channels". Hover over this and click on the Settings icon that will appear. In the pop-up, navigate to "+ Add Integration" and search for AWS SNS.
  1. Add AWS SNS as a provider: Click "Add Channel" and use the search bar to find "AWS SNS"

Profile Requirements

Push

To deliver a message to a mobile device over SNS, Courier must be provided either the Topic ARN, that the device is subscribed to, or the Target ARN that the device is subscribed to. If using a Target ARN, then this value should be included in the recipient profile as target_arn.

JSON
{
"message": {
"to": {
"target_arn": "your:target:arn"
}
}
}

If no target_arn is provided in the recipient profile then the Topic ARN will be used from the Courier configuration.

Either the Target ARN or the Topic ARN should be provided, not both.

SMS

To deliver a message to a recipient over AWS SNS, Courier must be provided the recipient's phone number. This value should be included in the recipient profile as phone_number.

JSON
{
"message": {
"to": {
"phone_number": "+12345678901"
}
}
}

Override

Overrides can be used to change the request body that Courier uses to send a sms message. Overrides are useful when a field is not yet supported by Courier or you would like to override the value that Courier generates.

You can override both the Access Key Id and the Secret Access Key supported by AWS SNS sdk (see all send publish properties here). Below is an example of overriding the Access Key Id and Secret Access Key for the configuration:

JSON
{
"message": {
"template": "<COURIER_NOTIFICATION_ID>",
"to": {},
"data": {},
"providers": {
"aws-sns": {
"override": {
"config": {
"accessKeyId": “<your Access Key Id>”,
"secretAccessKey": "<your Secret Access Key>",
}
}
}
}
}
}
Was this helpful?