Amazon SNS
  • 31 Jan 2023
  • 2 Minutes to read
  • Dark

Amazon SNS

  • Dark

Article Summary

Amazon Simple Notification Service (SNS) is a messaging service offered as a part of Amazon Web Services. It can be used for both application-to-application and application-to-person communications.

Amazon SNS can serve as a "communication bus" for the following AWS services:

  • Amazon CloudWatch: Alarms
  • Amazon GuardDuty: Findings, and additional sources of alerts and events.

1. Create an Amazon SNS integration in Torq

Perform these steps in Torq.

  1. Go to the Integrations page, locate the Amazon SNS card, and click Add
  2. Enter a meaningful name for the integration. We recommend that the integration name identify what events it will be sending.
  3. Click Add.
  4. Copy the integration webhook URL - it will serve as the endpoint when creating a subscription in AWS.

2. Create a new SNS topic (optional)

This step is optional. You should only create a new SNS topic if the integration will receive events that are not already being sent to an existing SNS topic. You should skip this step if you already have a topic that contains (or will contain) the relevant events.

You can create the topic using the AWS console or the AWS CLI.

Using the AWS console

  1. In the AWS console navigate to Amazon SNS / Topics.
  2. Click Create topic.
  3. Select Standard type and enter a meaningful name, such as torq-integration-topic .
  4. Click Create topic.

Using the AWS CLI

Run the following command.

aws sns create-topic --name torq-integration-topic

The result should look similar to the following:

    "ResponseMetadata": {
        "RequestId": "1469e8d7-1642-564e-b85d-a19b4b341f83"
    "TopicArn": "arn:aws:sns:us-west-2:123456789012:torq-integration-topic"

3. Subscribe Torq to an SNS topic

This step configures how SNS messages will be sent to the HTTPS Endpoint defined in the Amazon SNS Integration.

You can subscribe to the SNS topic using the AWS console or the AWS CLI.

Using the AWS console

  1. In the AWS Console navigate to Amazon SNS / Subscriptions.
  2. Click Create subscription.
  3. Select the Topic ARN either for the topic you created in the previous step or for an already created topic that contains the relevant messages.
  4. From the Protocol dropdown menu select HTTPS.
  5. In the Endpoint field paste the endpoint of the Amazon SNS integration you configured in Torq.
  6. Click Create subscription.

Using the AWS CLI

Run the following command:

aws sns subscribe \
    --topic-arn <ARN Topic> \
    --protocol HTTPS \
    --notification-endpoint <endpoint of the _Amazon SNS_ integration you configured in Torq> \
    --attributes RawMessageDelivery=true

The result should look like this:

    "SubscriptionArn": "pending confirmation"

4. Confirm the subscription

After you subscribe your endpoint, Amazon SNS will send a subscription confirmation message to the endpoint. This message appears in the Event Log for the webhook.

  1. In Torq, navigate to the Activity Log. You can optionally filter the log by the source, in this case, whatever name you gave the Amazon SNS integration. Click the event matching the message sent from Amazon SNS. It will look similar to the following.Screenshot showing the Torq activity log to verify the event.
  2. Click the link under SubscribeURL.Screenshot showing the event log in Torq to verify the subscription.

This will confirm the subscription and all future events matching the topics you defined will be sent to the webhook.

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.