Skip to main content

Amazon SNS

Integrate SNS with Torq to receive alerts and findings from AWS services.

Updated over 2 weeks 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 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

  1. Add the Integration: Navigate to Build > Integrations > Triggers > Amazon SNS and click Add Instance.

  2. Configure the Integration: Enter a unique and meaningful name.

  3. 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

  1. Open AWS SNS: Sign in to the AWS Management Console and go to Simple Notification Service.

  2. Create a Topic: Select Topics > Create topic.

    1. Select the Standard type.

    2. Enter a unique and meaningful name.

  3. Finalize: Click Create topic.

Using the AWS CLI

  1. 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

  1. Open AWS SNS: Go to Simple Notification Service in the AWS Management Console.

  2. Create a Subscription: Select Subscriptions > Create subscription.

  3. Select a Topic ARN: This ARN should either be for the topic you created earlier or for a previously created topic containing relevant messages.

  4. Select a Protocol: Select the HTTPS endpoint.

  5. Enter the Endpoint: Paste the URL that you generated earlier in Torq.

  6. Enable raw message delivery: Click enable raw message delivery.

  7. Finalize: Click Create subscription and wait until the subscription's status changes to Confirmed.

Using the AWS CLI

  1. 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.

Did this answer your question?