Skip to main content
Amazon SNS

Learn to integrate AWS SNS with Torq for alerts: Setup tips, SNS topic creation, subscription, and confirmation guidance.

Updated over 7 months ago

Amazon Simple Notification Service (SNS) is a messaging service offered by 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.

Create an Amazon SNS integration in Torq

  1. Go to Build > Integrations > Triggers > Amazon SNS, 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.

Create a New SNS Topic (Optional)

This step is optional. You should only create a new SNS topic if the integration will receive events 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"
  }

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 containing relevant messages.

  4. From the Protocol dropdown menu, select HTTPS.

  5. In the Endpoint field, paste the webhook 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      --protocol HTTPS     --notification-endpoint      --attributes RawMessageDelivery=true

The result should look like this:

{
    "SubscriptionArn": "pending confirmation"
}

Confirm the Subscription

After you subscribe, 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 Monitor > 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. This will confirm the subscription, and all future events matching the topics you defined will be sent to the webhook.

    Screenshot showing the event log in Torq to verify the subscription.

Did this answer your question?