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 EventBridge: alarms
Amazon GuardDuty: findings, alerts, and events
Use Amazon SNS to Trigger Workflows in Torq
Step One: Create an SNS Trigger Integration in Torq
Add the Integration: Navigate to Build > Integrations > Triggers > Amazon SNS and click Add Instance.
Configure the Integration: Enter a unique and meaningful name.
Finalize: Click Add and Copy the generated endpoint. You will need the URL to create the subscription in AWS.
Step Two: Create an SNS Topic
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
Open AWS SNS: Sign in to the AWS Management Console and go to Simple Notification Service.
Create a Topic: Select Topics > Create topic.
Select the Standard type.
Enter a unique and meaningful name.
Finalize: Click Create topic.
Using the AWS CLI
Open Your Command-line Shell: Run the command below.
aws sns create-topic --region <desired region> --name <desired topic name>
The result should look similar to the following:
{
"ResponseMetadata": {
"RequestId": "1469e8d7-1642-564e-b85d-a19b4b341f83"
},
"TopicArn": "arn:aws:sns:us-west-2:123456789012:your-topic"
}
Step Three: 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
Open AWS SNS: Go to Simple Notification Service in the AWS Management Console.
Create a Subscription: Select Subscriptions > Create subscription.
Select a Topic ARN: This ARN should either be for the topic you created earlier or for a previously created topic containing relevant messages.
Select a Protocol: Select the HTTPS endpoint.
Enter the Endpoint: Paste the URL that you generated earlier in Torq.
Enable raw message delivery: Click enable raw message delivery.
Finalize: Click Create subscription and wait until the subscription's status changes to Confirmed.
Using the AWS CLI
Open Your Command-line Shell: Run the command below.
aws sns subscribe \
--topic-arn <YOUR SNS TOPIC ARN> \
--protocol https \
--notification-endpoint <YOUR TORQ TRIGGER URL> \
--attributes RawMessageDelivery=true
The result should look similar to the following:
{ "SubscriptionArn": "pending confirmation" }
Now that you've successfully created an SNS trigger, you can build your first SNS–initiated workflow!
In Torq, go to Build > Workflows > Create a Workflow > New Blank Workflow, and select the trigger type: Integrations > Amazon SNS. Find your new trigger, and automate away!
Templates
Now that you've added your integrations, check out these specially crafted templates by Torq's security experts. Visit Torq's template library for more.