---
title: c AWS Simple Notification System (SNS)
description: Available connectors
documentId: ipaas-aws-sns
locale: en-US
---

The [**AWS SNS**](https://camel.apache.org/components/4.10.x/aws2-sns-component.html) component allows messages to be sent to an Amazon Simple Notification Topic.

**URI Syntax**: `aws2-sns:topicNameOrArn`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
|`topicNameorArn` (producer) | (required) Topic name or ARN |— | String |

*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `accessKey`(security) | Amazon AWS access key.| — | String |
| `secretKey`(security) | Amazon AWS secret key.  | — | String |

## Example

<Steps>
<Step>
 The flow starts with a POST request to the `/hello` endpoint with a message in the body.
</Step>
<Step>
 Then, it logs the received content.
</Step>
<Step>
 Next, it publishes the message to AWS SNS:
  - Topic: identified by `{sns-arn}` (Amazon Resource Name of the topic)
  - Region: `us-east-1` (AWS region where the topic is configured)
  - Authentication: `accessKey` and `secretKey` (AWS credentials stored in variables, indicated by double curly braces). Read about [flow variables](/docs/integrations/ipaas-flow-variables) configuration.
  - The body content is published as a message to the topic.
</Step>
</Steps>

```yaml
- from:
            uri: "rest:post:/hello"
            steps:
              - to: "log:info"
              - to:
                  uri: aws2-sns://{sns-arn}
                  parameters:
                    accessKey: "{{ACCESS_KEY}}"
                    secretKey: "{{SECRET_KEY}}"
                    region: us-east-1

```
![](../assets/component-aws-sns.png)

<Callout type="important" title="IMPORTANT">
When using `accessKey` and `secretKey` as query parameters, you need to pay attention to special characters. If the values contain characters like `+`, `/` or `=`, use the `RAW()` prefix to avoid encoding issues. See an example:

```
uri: aws2-sns://{sns-arn}
parameters: 
   accessKey=RAW(xxxxx)
   secretKey=RAW(yyyyy)
```

Where `xxxxx` and `yyyyy` are the actual key values.

The `RAW()` ensures that Camel treats credentials as literal text, avoiding misinterpretation of special characters. See more details at [How do I configure endpoints?](https://camel.apache.org/manual/faq/how-do-i-configure-endpoints.html)

</Callout>

### cURL

```
curl --location --request POST 'https://sensedia-integration-camel-poc.f6g7h8i9j0.integrations-tst.sensedia-eng.com/hello' \
--header 'Content-Type: application/json' \
--data-raw '{
    "message": "test message"
}'
```

### Result

```
{
  "Type" : "Notification",
  "MessageId" : "0ab14617-c6b0-5c5b-b19a-1861816d85bc",
  "TopicArn" : "arn:aws:sns:us-east-1:743047814061:poc_camel_components_pode_deletar",
  "Message" : "{\n    \"message\": \"test message\"\n}",
  "Timestamp" : "2024-03-21T14:35:09.640Z",
  "SignatureVersion" : "1",
  "Signature" : "NWrG0DWFwS/TimgQRzQpqfbkzZG1vxw3xUm66hqmFzHgRAGmFnASqJlQRdIqXl6dcTBFWQnXBtJW1wTJElGvMxBFlutGLxu/lhxeblm274cC0ilkfmopKAb7DOVl4y71uenAp+iqrtXiDgGi/35EoyFBv8BJzXPaQCQPOzchAJjrk4D2La40UGmAPXhpQfSdgIrlR4mm8yAtxQqZANYUYhlbCq4utAwT6x0yucGKAc+oeJ4n86+WV81xeRy5t9sEiMZuHsFAb54YIBdtzd4Jou0QmukhCwGq18jSIK6hv6mrWhxf4KOkvZoTetgwOaSBgEwA==",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-60eadc576ef735.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:743:poc_camel_components_pode_deletar:62e2b1e5-5045-4871-ae01-ede022d0898a",
  "MessageAttributes" : {
    "Accept" : {"Type":"String","Value":"*/*"},
    "X-Request-Id" : {"Type":"String","Value":"fb132f64-5802-4c1c-9719-febc8220350b"},
    "User-Agent" : {"Type":"String","Value":"PostmanRuntime/7.29.4"},
    "X-Forwarded-Proto" : {"Type":"String","Value":"http"},
    "X-Request-Start" : {"Type":"String","Value":"t=1711031709.586"},
    "Host" : {"Type":"String","Value":"sensedia-integration-camel-poc.f6g7h8i9j0.integrations-tst.sensedia-eng.com"},
    "Accept-Encoding" : {"Type":"String","Value":"gzip, deflate, br"},
    "K-Proxy-Request" : {"Type":"String","Value":"activator"},
    "Forwarded" : {"Type":"String","Value":"for=152.249.179.170;proto=http, for=10.251.183.10"},
    "X-Forwarded-For" : {"Type":"String","Value":"152.249.179.170, 10.251.183.10, 10.251.199.207"},
    "Content-Length" : {"Type":"String","Value":"29"},
    "Content-Type" : {"Type":"String","Value":"application/json"},
    "X-Envoy-External-Address" : {"Type":"String","Value":"152.249.179.170"}
  }
}
```
