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
Go to Build > Integrations > Triggers > Amazon SNS, and click Add.
Enter a meaningful name for the integration. We recommend that the integration name identify what events it will be sending.
Click Add.
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
In the AWS console, navigate to Amazon SNS / Topics.
Click Create topic.
Select Standard type and enter a meaningful name, such as torq-integration-topic .
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
In the AWS Console, navigate to Amazon SNS / Subscriptions.
Click Create subscription.
Select the Topic ARN either for the topic you created in the previous step or for an already created topic containing relevant messages.
From the Protocol dropdown menu, select HTTPS.
In the Endpoint field, paste the webhook of the Amazon SNS integration you configured in Torq.
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.
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.
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.